Class HeadlessClient

All Implemented Interfaces:
IClient

public class HeadlessClient extends Client
This class is instantiated for the player. It allows to communicate with the server with no GUI attached.
  • Field Details

  • Constructor Details

    • HeadlessClient

      public HeadlessClient(String name, String host, int port)
  • Method Details

    • cacheImgTag

      protected void cacheImgTag(Entity entity)
      A client with no GUI has nothing to show an entity's picture in, so it does not cache one.

      Building that cache is what pulls in the hex tile set, which parses thousands of template hexes and their terrain. BotClient already declines it for the same reason; a headless client wants it no more than a bot does, and anywhere clients are created repeatedly - a benchmark playing many games in one process - the cost is paid and retained once per game.

      Overrides:
      cacheImgTag in class Client
      Parameters:
      entity - ignored
    • setSendDoneOnVictoryAutomatically

      public void setSendDoneOnVictoryAutomatically(boolean value)
    • changePhase

      public void changePhase(GamePhase phase)
      Description copied from class: Client
      Changes the game phase, and the displays that go along with it.
      Overrides:
      changePhase in class Client
      Parameters:
      phase - the phase switching from.