Class GameWorld
java.lang.Object
dev.zwazel.GameWorld
- All Implemented Interfaces:
InternalGameWorld
,PublicGameWorld
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
getBot()
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.boolean
isDebug()
Returns if the game is currently in debug mode.boolean
boolean
Returns if the game is currently running.void
pushIncomingMessage
(MessageContainer message) void
registerVisualiser
(JPanel panel) void
send
(MessageContainer message) Adds a message to the outgoing message queue.void
setGameConfig
(GameConfig gameConfig) void
static boolean
startGame
(BotInterface bot) void
stop()
void
updatePredictedState
(ClientState newState) void
updateState
(GameState newState) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
pushIncomingMessage
in interfaceInternalGameWorld
-
updateState
- Specified by:
updateState
in interfaceInternalGameWorld
-
updatePredictedState
- Specified by:
updatePredictedState
in interfaceInternalGameWorld
-
getIncomingMessageQueue
- Specified by:
getIncomingMessageQueue
in interfaceInternalGameWorld
-
getOutgoingMessageQueue
- Specified by:
getOutgoingMessageQueue
in interfaceInternalGameWorld
-
startGame
public void startGame()- Specified by:
startGame
in interfaceInternalGameWorld
-
isRunning
public boolean isRunning()Description copied from interface:PublicGameWorld
Returns if the game is currently running.- Specified by:
isRunning
in interfacePublicGameWorld
- Returns:
- true if the game is running, false otherwise
-
isDebug
public boolean isDebug()Description copied from interface:PublicGameWorld
Returns if the game is currently in debug mode.- Specified by:
isDebug
in interfacePublicGameWorld
- Returns:
- true if the game is in debug mode, false otherwise
-
send
Description copied from interface:PublicGameWorld
Adds a message to the outgoing message queue.- Specified by:
send
in interfacePublicGameWorld
- Parameters:
message
- the message to send
-
getGameState
Description copied from interface:PublicGameWorld
Get the current game state.- Specified by:
getGameState
in interfacePublicGameWorld
- Returns:
- the current game state
-
getMyPredictedState
- Specified by:
getMyPredictedState
in interfacePublicGameWorld
-
getGameConfig
Description copied from interface:PublicGameWorld
Get the game configuration.- Specified by:
getGameConfig
in interfacePublicGameWorld
- Returns:
- the game configuration
-
setGameConfig
- Specified by:
setGameConfig
in interfaceInternalGameWorld
-
getIncomingMessages
Description copied from interface:PublicGameWorld
Returns a copy of the current tick's incoming messages.- Specified by:
getIncomingMessages
in interfacePublicGameWorld
- Returns:
- a list of incoming messages
-
registerVisualiser
- Specified by:
registerVisualiser
in interfacePublicGameWorld
-
stop
public void stop()- Specified by:
stop
in interfaceInternalGameWorld
-
isInternalDebug
public boolean isInternalDebug()- Specified by:
isInternalDebug
in interfaceInternalGameWorld
-
getTank
Description copied from interface:PublicGameWorld
Get the tank instance of the client. Cast to the correct tank type to access tank-specific methods.- Specified by:
getTank
in interfacePublicGameWorld
- Returns:
- the tank interface instance
-
getPublicGameWorld
- Specified by:
getPublicGameWorld
in interfaceInternalGameWorld
-
getConnectionManager
- Specified by:
getConnectionManager
in interfaceInternalGameWorld
-
getBot
- Specified by:
getBot
in interfaceInternalGameWorld
-