Interface PublicGameWorld
-
Method Summary
Modifier and TypeMethodDescriptiondefault ClientStategetClientState(ConnectedClientConfig clientConfig) default ClientStategetClientState(Long clientId) Get the state of a specific client.default Optional<ClientState> getClientState(String clientName) default Optional<ConnectedClientConfig> getConnectedClientConfig(ClientState clientState) default Optional<ConnectedClientConfig> getConnectedClientConfig(Long clientId) default Optional<ConnectedClientConfig> getConnectedClientConfig(String clientName) Get the game configuration.Get the current game state.Returns a copy of the current tick's incoming messages.default List<MessageContainer> getIncomingMessages(Class<? extends MessageData> messageDataType) Returns a copy of the current tick's incoming messages of a specific type.default ClientStateGet my current state.getTank()Get the tank instance of the client.default Optional<TankConfig> getTankConfig(TankType tankType) 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).default List<ClientState> getTeamClientStates(String teamName, Long excludeClientId) Get the client states of all clients in a team, excluding a specific client.booleanisDebug()Returns if the game is currently in debug mode.booleanReturns if the game is currently running.voidregisterVisualiser(JPanel panel) voidsend(MessageContainer message) Adds a message to the outgoing message queue.
-
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
Adds a message to the outgoing message queue.- Parameters:
message- the message to send
-
getGameState
-
getMyState
-
getMyPredictedState
ClientState getMyPredictedState() -
getClientState
Get the state of a specific client.- Parameters:
clientId- the client id- Returns:
- the client state
-
getClientState
-
getClientState
-
getConnectedClientConfig
-
getConnectedClientConfig
-
getConnectedClientConfig
-
getTeamClientStates
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
Get the client states of all clients in a team, excluding a specific client.- Parameters:
teamName- the team nameexcludeClientId- 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
-
getIncomingMessages
List<MessageContainer> getIncomingMessages()Returns a copy of the current tick's incoming messages.- Returns:
- a list of incoming messages
-
getIncomingMessages
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
-
registerVisualiser
-