megamek.client.bot
Class TestBot

java.lang.Object
  extended by megamek.client.Client
      extended by megamek.client.bot.BotClient
          extended by megamek.client.bot.TestBot
All Implemented Interfaces:
IClientCommandHandler

public class TestBot
extends BotClient


Nested Class Summary
 class TestBot.CalculateEntityMove
          Used by the function calculateMoveTurn to run each entities movement calculation in a separate thread.
 
Nested classes/interfaces inherited from class megamek.client.bot.BotClient
BotClient.CalculateBotTurn, BotClient.FitnessComparator
 
Field Summary
 CEntity.Table centities
           
protected  ChatProcessor chatp
           
(package private)  boolean debug
           
protected  int ignore
           
 
Fields inherited from class megamek.client.bot.BotClient
config
 
Fields inherited from class megamek.client.Client
bots, CLIENT_COMMAND, game, local_pn, phaseReport, roundReport
 
Constructor Summary
TestBot(java.lang.String name, java.lang.String host, int port)
           
 
Method Summary
 double attackUtility(MoveOption es, CEntity target)
           
 GAAttack bestAttack(MoveOption es)
           
 GAAttack bestAttack(MoveOption es, CEntity target, int search_level)
           
protected  PlayerIDandList<Coords> calculateArtyAutoHitHexes()
           
protected  void calculateDeployment()
           
 void calculateFiringTurn()
           
protected  java.util.Vector<Minefield> calculateMinefieldDeployment()
           
 MoveOption[] calculateMove(Entity entity)
           
 MovePath calculateMoveTurn()
           
 PhysicalOption calculatePhysicalTurn()
           
protected  java.util.ArrayList<AttackOption> calculateWeaponAttacks(Entity en, Mounted mw, boolean best_only)
           
protected  MovePath continueMovementFor(Entity entity)
           
protected  void deployMinefields(java.util.Vector<Minefield> deployedMinefields, int number, int type)
           
protected  void initFiring()
           
 void initialize()
           
protected  void initMovement()
          consider how to put more pre-turn logic here
protected  void processChat(GamePlayerChatEvent ge)
           
 
Methods inherited from class megamek.client.bot.BotClient
calculateMyTurn, changePhase, getCoordsAround, getEnemyEntities, getEntitiesOwned, getRandomBotMessage, getStartingCoords, getStartingCoordsArray, retrieveServerInfo
 
Methods inherited from class megamek.client.Client
addCloseClientListener, canUnloadStranded, changeTurnIndex, connect, deploy, deploy, die, disconnected, flushConn, getAllCommandNames, getArtilleryAutoHit, getBoard, getCommand, getEntities, getEntity, getFirstDeployableEntityNum, getFirstEntityNum, getHost, getLocalPlayer, getMapSettings, getMyTurn, getName, getNextDeployableEntityNum, getNextEntityNum, getPlayer, getPlayers, getPort, getSelectedEntities, handlePacket, isMyTurn, moveEntity, receiveAttack, receiveBoard, receiveBuildingCollapse, receiveBuildingUpdateCF, receiveDeployMinefields, receiveEntities, receiveEntityAdd, receiveEntityRemove, receiveEntityUpdate, receiveEntityVisibilityIndicator, receivePlayerInfo, receiveRemoveMinefield, receiveReport, receiveRevealMinefield, receiveSendingMinefields, receiveTurns, receiveUpdateMinefields, registerCommand, runCommand, runCommand, send, sendAddEntity, sendAddSquadron, sendAmmoChange, sendArtyAutoHitHexes, sendAttackData, sendCalledShotChange, sendChat, sendCustomInit, sendDeleteEntity, sendDeployMinefields, sendDone, sendGameOptions, sendLoadGame, sendMapDimensions, sendMapSettings, sendModeChange, sendPlanetaryConditions, sendPlayerInfo, sendRerollInitiativeRequest, sendSystemModeChange, sendUnloadStranded, sendUpdateEntity, setName, updateConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centities

public CEntity.Table centities

chatp

protected ChatProcessor chatp

ignore

protected int ignore

debug

boolean debug
Constructor Detail

TestBot

public TestBot(java.lang.String name,
               java.lang.String host,
               int port)
Method Detail

initialize

public void initialize()
Specified by:
initialize in class BotClient

calculatePhysicalTurn

public PhysicalOption calculatePhysicalTurn()
Specified by:
calculatePhysicalTurn in class BotClient

calculateMoveTurn

public MovePath calculateMoveTurn()
Specified by:
calculateMoveTurn in class BotClient

calculateMove

public MoveOption[] calculateMove(Entity entity)

initFiring

protected void initFiring()
Specified by:
initFiring in class BotClient

calculateWeaponAttacks

protected java.util.ArrayList<AttackOption> calculateWeaponAttacks(Entity en,
                                                                   Mounted mw,
                                                                   boolean best_only)

bestAttack

public GAAttack bestAttack(MoveOption es)

bestAttack

public GAAttack bestAttack(MoveOption es,
                           CEntity target,
                           int search_level)

attackUtility

public double attackUtility(MoveOption es,
                            CEntity target)

calculateFiringTurn

public void calculateFiringTurn()
Specified by:
calculateFiringTurn in class BotClient

initMovement

protected void initMovement()
consider how to put more pre-turn logic here

Specified by:
initMovement in class BotClient

processChat

protected void processChat(GamePlayerChatEvent ge)
Specified by:
processChat in class BotClient

calculateDeployment

protected void calculateDeployment()
Specified by:
calculateDeployment in class BotClient

continueMovementFor

protected MovePath continueMovementFor(Entity entity)
Specified by:
continueMovementFor in class BotClient

calculateMinefieldDeployment

protected java.util.Vector<Minefield> calculateMinefieldDeployment()
Specified by:
calculateMinefieldDeployment in class BotClient

calculateArtyAutoHitHexes

protected PlayerIDandList<Coords> calculateArtyAutoHitHexes()
Specified by:
calculateArtyAutoHitHexes in class BotClient

deployMinefields

protected void deployMinefields(java.util.Vector<Minefield> deployedMinefields,
                                int number,
                                int type)