Class GameWorld
java.lang.Object
dev.zwazel.GameWorld
- All Implemented Interfaces:
InternalGameWorld,PublicGameWorld
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBot()Get the game configuration.Get the current game state.Returns a copy of the current tick's incoming messages.getTank()Get the tank instance of the client.booleanisDebug()Returns if the game is currently in debug mode.booleanbooleanReturns if the game is currently running.voidpushIncomingMessage(MessageContainer message) voidregisterVisualiser(JPanel panel) voidsend(MessageContainer message) Adds a message to the outgoing message queue.voidsetGameConfig(GameConfig gameConfig) voidstatic booleanstartGame(BotInterface bot) voidstop()voidupdatePredictedState(ClientState newState) voidupdateState(GameState newState) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.zwazel.internal.PublicGameWorld
getClientState, getClientState, getClientState, getConnectedClientConfig, getConnectedClientConfig, getConnectedClientConfig, getIncomingMessages, getMyState, getTankConfig, getTeamClientStates, getTeamClientStates
-
Method Details
-
startGame
-
connectToServer
-
pushIncomingMessage
- Specified by:
pushIncomingMessagein interfaceInternalGameWorld
-
updateState
- Specified by:
updateStatein interfaceInternalGameWorld
-
updatePredictedState
- Specified by:
updatePredictedStatein interfaceInternalGameWorld
-
getIncomingMessageQueue
- Specified by:
getIncomingMessageQueuein interfaceInternalGameWorld
-
getOutgoingMessageQueue
- Specified by:
getOutgoingMessageQueuein interfaceInternalGameWorld
-
startGame
public void startGame()- Specified by:
startGamein interfaceInternalGameWorld
-
isRunning
public boolean isRunning()Description copied from interface:PublicGameWorldReturns if the game is currently running.- Specified by:
isRunningin interfacePublicGameWorld- Returns:
- true if the game is running, false otherwise
-
isDebug
public boolean isDebug()Description copied from interface:PublicGameWorldReturns if the game is currently in debug mode.- Specified by:
isDebugin interfacePublicGameWorld- Returns:
- true if the game is in debug mode, false otherwise
-
send
Description copied from interface:PublicGameWorldAdds a message to the outgoing message queue.- Specified by:
sendin interfacePublicGameWorld- Parameters:
message- the message to send
-
getGameState
Description copied from interface:PublicGameWorldGet the current game state.- Specified by:
getGameStatein interfacePublicGameWorld- Returns:
- the current game state
-
getMyPredictedState
- Specified by:
getMyPredictedStatein interfacePublicGameWorld
-
getGameConfig
Description copied from interface:PublicGameWorldGet the game configuration.- Specified by:
getGameConfigin interfacePublicGameWorld- Returns:
- the game configuration
-
setGameConfig
- Specified by:
setGameConfigin interfaceInternalGameWorld
-
getIncomingMessages
Description copied from interface:PublicGameWorldReturns a copy of the current tick's incoming messages.- Specified by:
getIncomingMessagesin interfacePublicGameWorld- Returns:
- a list of incoming messages
-
registerVisualiser
- Specified by:
registerVisualiserin interfacePublicGameWorld
-
stop
public void stop()- Specified by:
stopin interfaceInternalGameWorld
-
isInternalDebug
public boolean isInternalDebug()- Specified by:
isInternalDebugin interfaceInternalGameWorld
-
getTank
Description copied from interface:PublicGameWorldGet the tank instance of the client. Cast to the correct tank type to access tank-specific methods.- Specified by:
getTankin interfacePublicGameWorld- Returns:
- the tank interface instance
-
getPublicGameWorld
- Specified by:
getPublicGameWorldin interfaceInternalGameWorld
-
getConnectionManager
- Specified by:
getConnectionManagerin interfaceInternalGameWorld
-
getBot
- Specified by:
getBotin interfaceInternalGameWorld
-