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
Abstract rule bean, used to check the rules of othello.
Added parameter to specify the color of the piece placed so it does not have to already be placed before validation.

Version:
t.4
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, java.lang.String placed)
          Loops through all the starting from the cell specified and flips the pieces if valid.
 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, java.lang.String placed)
          Validates the point, based on the current game board and the color.
 
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,
                                 java.lang.String placed)
Validates the point, based on the current game board and the color.

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 abstract 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.

Parameters:
cells - The game board to modify.
cp - The origin of the flipping.
placed - The color placed.