vooga.examples.networking.tictactoe.events
Class GameLostEvent

java.lang.Object
  extended by vooga.examples.networking.tictactoe.events.GameLostEvent
All Implemented Interfaces:
IEventHandler

public class GameLostEvent
extends java.lang.Object
implements IEventHandler

Detects and informs the PlayState when the player has lost (3 'O' pieces in a row.) No network API code.


Constructor Summary
GameLostEvent(PlayField field, PlayState playState)
          Give GameLostEvent access to the main PlayField and the PlayState.
 
Method Summary
 void actionPerformed()
          If there are 3 'O' pieces in a row then tell the PlayState it lost.
 boolean isTriggered()
          User defines the condition when the event will be triggered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameLostEvent

public GameLostEvent(PlayField field,
                     PlayState playState)
Give GameLostEvent access to the main PlayField and the PlayState.

Method Detail

actionPerformed

public void actionPerformed()
If there are 3 'O' pieces in a row then tell the PlayState it lost.

Specified by:
actionPerformed in interface IEventHandler

isTriggered

public boolean isTriggered()
Description copied from interface: IEventHandler
User defines the condition when the event will be triggered

Specified by:
isTriggered in interface IEventHandler
Returns:
if there are 3 'O' pieces in a row