Package megamek.client
Class SBFClient
java.lang.Object
megamek.client.AbstractClient
megamek.client.SBFClient
- All Implemented Interfaces:
IClient
This is the game client for Strategic BattleForce games, as one would think.
-
Nested Class Summary
Nested classes/interfaces inherited from class megamek.client.AbstractClient
AbstractClient.ConnectionHandler -
Field Summary
Fields inherited from class megamek.client.AbstractClient
awaitingSave, bots, connected, connection, connectionListener, connThread, disconnectFlag, host, iconCache, localPlayerNumber, log, name, phaseReport, port, roundReport, unitNameTracker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcacheImgTag(InGameObject unit) Hashtable for storing img tags containing base64Text src.getGame()Returns the game of this client as a game-type independent IGame.protected booleanhandleGameSpecificPacket(Packet packet) Handles any Packets that are specific to the game type (TW, AS...).booleanisMyTurn()voidmoveUnit(SBFMovePath movePath) protected voidreceiveEntities(Packet packet) Loads the entities from the data in the net command.voidsendAttackData(List<EntityAction> attacks, int formationId) Methods inherited from class megamek.client.AbstractClient
addCloseClientListener, changePhase, checkDuplicateNamesDuringAdd, connect, correctName, die, disconnected, fireSaveCompleted, flushConn, getBots, getHost, getLocalPlayerNumber, getName, getPort, handleGameIndependentPacket, handlePacket, initGameLog, isAwaitingSave, isBot, isConnected, keepGameLog, memDump, possiblyWriteToLog, receivePlayerInfo, receiveUnitReplace, send, sendArtilleryRevealPreference, sendChat, sendDone, sendNextPlayer, sendPause, sendPlayerInfo, sendPlayerInfo, sendServerChat, sendUnpause, setAwaitingSave, setLocalPlayerNumber, setName, setSaveCompletionCallback, updateConnectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface megamek.client.IClient
getBotClient, getInGameObject, getInGameObjects, getLocalPlayer, getPlayer, isLocalBot, playerExists
-
Constructor Details
-
SBFClient
Construct a client which will try to connect. If the connection fails, it will alert the player, free resources and hide the frame.- Parameters:
name- the player name for this clienthost- the hostnameport- the host port
-
-
Method Details
-
getGame
Description copied from interface:IClientReturns the game of this client as a game-type independent IGame. Note that the game object is only updated, not replaced and a reference to it can therefore be kept.- Returns:
- The game of this client
-
isMyTurn
public boolean isMyTurn()- Returns:
- True when the currently active turn is a turn for the local player
-
handleGameSpecificPacket
Description copied from class:AbstractClientHandles any Packets that are specific to the game type (TW, AS...). When implementing this, make sure that this doesn't do duplicate actions withAbstractClient.handleGameIndependentPacket(Packet)- but packets may be handled in both methods (all packets traverse both methods).When making changes, do not forget to update Precognition which is a Client clone but unfortunately not a subclass.
- Specified by:
handleGameSpecificPacketin classAbstractClient- Parameters:
packet- The packet to handle- Returns:
- True when the packet has been handled
-
receiveEntities
Loads the entities from the data in the net command.- Throws:
InvalidPacketDataException
-
cacheImgTag
Hashtable for storing img tags containing base64Text src. -
moveUnit
-
sendAttackData
-