rules
Class UpRuleBean

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

public class UpRuleBean
extends AbRuleBean
implements java.io.Serializable

Created on November 3, 2006, 7:19 PM
Implements the rule to validate and flip pieces in an up direction.

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

Constructor Summary
UpRuleBean()
          Creates a new instance of UpRuleBean
 
Method Summary
 void flipPieces(OthelloCell[][] cells, java.awt.Point cp)
          Whether to flip the pieces or not.
 boolean validate(OthelloCell[][] cells, java.awt.Point cp)
          Validates the piece is a valid move.
 
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

UpRuleBean

public UpRuleBean()
Creates a new instance of UpRuleBean

Method Detail

validate

public boolean validate(OthelloCell[][] cells,
                        java.awt.Point cp)
Validates the piece is a valid move.

Specified by:
validate in class AbRuleBean
Parameters:
cells - The game board to be validated against.
cp - The point to be validated.
Returns:
True if valid, false if not valid.

flipPieces

public void flipPieces(OthelloCell[][] cells,
                       java.awt.Point cp)
Whether to flip the pieces or not.

Specified by:
flipPieces in class AbRuleBean
Parameters:
cells - The game board to check.
cp - The point of origin for possible flipping.