rules
Class AbRuleBean

java.lang.Object
  extended by rules.AbRuleBean
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DownLeftRuleBean, DownRightRuleBean, DownRuleBean, LeftRuleBean, RightRuleBean, UpLeftRuleBean, UpRightRuleBean, UpRuleBean

public abstract class AbRuleBean
extends java.lang.Object
implements java.io.Serializable

Created on November 2, 2006, 9:49 PM The abstract rule class.
This is the foundation class for the rules used to govern flipping pieces and validating moves.

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

Constructor Summary
AbRuleBean()
          Creates a new instance of AbRuleBean
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds the property change listener.
abstract  void flipPieces(OthelloCell[][] cells, java.awt.Point cp)
          Whether to flip the pieces or not.
 java.beans.PropertyChangeSupport getPropertySupport()
          Gets the property change support.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes the property change listener.
abstract  boolean validate(OthelloCell[][] cells, java.awt.Point cp)
          Validates the piece is a valid move.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbRuleBean

public AbRuleBean()
Creates a new instance of AbRuleBean

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the property change listener.

Parameters:
listener - The new listener.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the property change listener.

Parameters:
listener - The listener to remove.

getPropertySupport

public java.beans.PropertyChangeSupport getPropertySupport()
Gets the property change support.

Returns:
The property change support.

validate

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

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 abstract void flipPieces(OthelloCell[][] cells,
                                java.awt.Point cp)
Whether to flip the pieces or not.

Parameters:
cells - The game board to check.
cp - The point of origin for possible flipping.