rules
Class DownRuleBean

java.lang.Object
  extended by rules.AbRuleBean
      extended by rules.DownRuleBean
All Implemented Interfaces:
java.io.Serializable

public class DownRuleBean
extends AbRuleBean
implements java.io.Serializable

Created on November 3, 2006, 7:19 PM
Defines the rule for checking and flipping pieces in down direction.

Version:
t.4
Author:
Eric Angeli
See Also:
Serialized Form

Constructor Summary
DownRuleBean()
          Creates a new instance of DownRuleBean
 
Method Summary
 void flipPieces(OthelloCell[][] cells, java.awt.Point cp, java.lang.String placed)
          Loops through all the starting from the cell specified and flips the pieces if valid.
 boolean validate(OthelloCell[][] cells, java.awt.Point cp, java.lang.String placed)
          Validates the point, based on the current game board and the color.
 
Methods inherited from class rules.AbRuleBean
addPropertyChangeListener, getPropertySupport, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownRuleBean

public DownRuleBean()
Creates a new instance of DownRuleBean

Method Detail

validate

public boolean validate(OthelloCell[][] cells,
                        java.awt.Point cp,
                        java.lang.String placed)
Validates the point, based on the current game board and the color.

Specified by:
validate in class AbRuleBean
Parameters:
cells - The game baord to validate.
cp - The point to be validated.
placed - The color placed on the board.
Returns:
True if valid, flas if not.

flipPieces

public void flipPieces(OthelloCell[][] cells,
                       java.awt.Point cp,
                       java.lang.String placed)
Loops through all the starting from the cell specified and flips the pieces if valid.

Specified by:
flipPieces in class AbRuleBean
Parameters:
cells - The game board to modify.
cp - The origin of the flipping.
placed - The color placed.