vooga.examples.networking.tictactoe.states
Class WaitingState

java.lang.Object
  extended by vooga.engine.state.GameState
      extended by vooga.examples.networking.tictactoe.states.WaitingState

public class WaitingState
extends GameState

GameState for when the Game is waiting for the second player to join.


Field Summary
 
Fields inherited from class vooga.engine.state.GameState
myRenderField, myUpdateField
 
Constructor Summary
WaitingState(Game game, ClientConnection connection, PlayField field, PlayState playState)
          Constructor for waiting GameState.
 
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
 

Constructor Detail

WaitingState

public WaitingState(Game game,
                    ClientConnection connection,
                    PlayField field,
                    PlayState playState)
Constructor for waiting GameState.

Parameters:
game - Game to be able to switch GameStates
connection - ClientConnection to get the latest message from the socket
field - PlayField for WaitingState to render
playState - PlayState to switch to and pass the message whenever it gets a non "wait" String from the socket
Method Detail

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