vooga.examples.networking.tictactoe.events
Class GameWonEvent

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

public class GameWonEvent
extends java.lang.Object
implements IEventHandler

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


Constructor Summary
GameWonEvent(PlayField field, PlayState playState)
          Give GameWonEvent access to the main PlayField and the PlayState.
 
Method Summary
 void actionPerformed()
          If there are 3 'X' pieces in a row then tell the PlayState it won.
 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

GameWonEvent

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

Method Detail

actionPerformed

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

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 'X' pieces in a row