Interface PublicGameWorld

All Known Implementing Classes:
GameWorld

public interface PublicGameWorld
  • Method Details

    • isRunning

      boolean isRunning()
      Returns if the game is currently running.
      Returns:
      true if the game is running, false otherwise
    • isDebug

      boolean isDebug()
      Returns if the game is currently in debug mode.
      Returns:
      true if the game is in debug mode, false otherwise
    • send

      void send(MessageContainer message)
      Adds a message to the outgoing message queue.
      Parameters:
      message - the message to send
    • getGameState

      GameState getGameState()
      Get the current game state.
      Returns:
      the current game state
    • getMyState

      default ClientState getMyState()
      Get my current state.
      Returns:
      my current state
    • getMyPredictedState

      ClientState getMyPredictedState()
    • getClientState

      default ClientState getClientState(Long clientId)
      Get the state of a specific client.
      Parameters:
      clientId - the client id
      Returns:
      the client state
    • getClientState

      default ClientState getClientState(ConnectedClientConfig clientConfig)
    • getClientState

      default Optional<ClientState> getClientState(String clientName)
    • getConnectedClientConfig

      default Optional<ConnectedClientConfig> getConnectedClientConfig(Long clientId)
    • getConnectedClientConfig

      default Optional<ConnectedClientConfig> getConnectedClientConfig(String clientName)
    • getConnectedClientConfig

      default Optional<ConnectedClientConfig> getConnectedClientConfig(ClientState clientState)
    • getTeamClientStates

      default List<ClientState> getTeamClientStates(String teamName)
      Get the client states of all clients in a team (could include the client itself, if it is part of the team).
      Parameters:
      teamName - the team name
      Returns:
      the client states of all clients in the team
    • getTeamClientStates

      default List<ClientState> getTeamClientStates(String teamName, Long excludeClientId)
      Get the client states of all clients in a team, excluding a specific client.
      Parameters:
      teamName - the team name
      excludeClientId - the client id to exclude
      Returns:
      the client states of all clients in the team
    • getTank

      Tank getTank()
      Get the tank instance of the client. Cast to the correct tank type to access tank-specific methods.
      Returns:
      the tank interface instance
    • getGameConfig

      GameConfig getGameConfig()
      Get the game configuration.
      Returns:
      the game configuration
    • getIncomingMessages

      List<MessageContainer> getIncomingMessages()
      Returns a copy of the current tick's incoming messages.
      Returns:
      a list of incoming messages
    • getIncomingMessages

      default List<MessageContainer> getIncomingMessages(Class<? extends MessageData> messageDataType)
      Returns a copy of the current tick's incoming messages of a specific type.
      Parameters:
      messageDataType - the type of message data to filter for
      Returns:
      a list of incoming messages of the specified type
    • getTankConfig

      default Optional<TankConfig> getTankConfig(TankType tankType)
    • registerVisualiser

      void registerVisualiser(JPanel panel)