Class SimulatedClient

java.lang.Object
megamek.common.autoResolve.acar.SimulatedClient
All Implemented Interfaces:
IClient

public class SimulatedClient extends Object implements IClient
  • Constructor Details

    • SimulatedClient

      public SimulatedClient(IGame game)
  • Method Details

    • getGame

      public IGame getGame()
      Description copied from interface: IClient
      Returns 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.
      Specified by:
      getGame in interface IClient
      Returns:
      The game of this client
    • getLocalPlayerNumber

      public int getLocalPlayerNumber()
      Specified by:
      getLocalPlayerNumber in interface IClient
      Returns:
      The ID of the player playing at this Client.
    • getLocalPlayer

      public Player getLocalPlayer()
      Specified by:
      getLocalPlayer in interface IClient
      Returns:
      The local player (playing at this Client).
    • connect

      public boolean connect()
      Description copied from interface: IClient
      Attempt to connect to the specified host
      Specified by:
      connect in interface IClient
      Returns:
      true if successful.
    • getName

      public String getName()
      Specified by:
      getName in interface IClient
      Returns:
      The name of Client, typically the same as the local player's name.
    • getPort

      public int getPort()
      Specified by:
      getPort in interface IClient
      Returns:
      The port that this Client uses to connect to the server.
    • getHost

      public String getHost()
      Specified by:
      getHost in interface IClient
      Returns:
      The server host address.
    • isMyTurn

      public boolean isMyTurn()
      Specified by:
      isMyTurn in interface IClient
      Returns:
      True when the currently active turn is a turn for the local player
    • setLocalPlayerNumber

      public void setLocalPlayerNumber(int localPlayerNumber)
      Description copied from interface: IClient
      Sets the ID of the player playing at this Client.
      Specified by:
      setLocalPlayerNumber in interface IClient
      Parameters:
      localPlayerNumber - The new local player's ID
    • getBots

      public Map<String,AbstractClient> getBots()
      Description copied from interface: IClient
      Returns the map containing this Client's local bots, wherein the key is the bot's player name and the value the Client.
      Specified by:
      getBots in interface IClient
      Returns:
      This Client's local bots mapped to their player name
    • sendDone

      public void sendDone(boolean done)
      Description copied from interface: IClient
      Sends a "this player is done/not done" message to the server.
      Specified by:
      sendDone in interface IClient
      Parameters:
      done - Is the player done or not.
    • sendChat

      public void sendChat(String message)
      Specified by:
      sendChat in interface IClient
    • sendPause

      public void sendPause()
      Specified by:
      sendPause in interface IClient
    • die

      public void die()
      Description copied from interface: IClient
      Cleans up and closes resources of this Client.
      Specified by:
      die in interface IClient