vooga.examples.networking.tictactoe.states
Class WaitingState
java.lang.Object
vooga.engine.state.GameState
vooga.examples.networking.tictactoe.states.WaitingState
public class WaitingState
- extends GameState
GameState for when the Game is waiting for the second player to join.
Method Summary |
void |
initialize()
The initialize method sets up specific variables and parameters necessary
to the specific functioning of the GameState. |
void |
render(java.awt.Graphics2D g)
Renders all sprites stored in the GameState's renderGroups. |
void |
update(long t)
If it receives a message from the socket that is not "wait", then switch to the PlayState and tell the PlayState what the message was. |
Methods inherited from class vooga.engine.state.GameState |
activate, addGroup, addPlayField, addRenderPlayField, addRenderState, addState, addUpdatePlayField, addUpdateState, deactivate, equals, getGroup, getRenderField, getUpdateField, isActive, removeEverything |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WaitingState
public WaitingState(Game game,
ClientConnection connection,
PlayField field,
PlayState playState)
- Constructor for waiting GameState.
- Parameters:
game
- Game to be able to switch GameStatesconnection
- ClientConnection to get the latest message from the socketfield
- PlayField for WaitingState to renderplayState
- PlayState to switch to and pass the message whenever it gets a non "wait" String from the socket
update
public void update(long t)
- If it receives a message from the socket that is not "wait", then switch to the PlayState and tell the PlayState what the message was.
- Overrides:
update
in class GameState
render
public void render(java.awt.Graphics2D g)
- Description copied from class:
GameState
- Renders all sprites stored in the GameState's renderGroups.
- Overrides:
render
in class GameState
initialize
public void initialize()
- Description copied from class:
GameState
- The initialize method sets up specific variables and parameters necessary
to the specific functioning of the GameState. This should include all of
the necessary initialization for the GameState's specific use, rather
than anything broadly required for all GameStates.
- Specified by:
initialize
in class GameState