rules
Class LeftRuleBean
java.lang.Object
rules.AbRuleBean
rules.LeftRuleBean
- All Implemented Interfaces:
- java.io.Serializable
public class LeftRuleBean
- extends AbRuleBean
- implements java.io.Serializable
Created on November 3, 2006, 5:59 PM
Defines the rule for checking and flipping pieces in left direction.
- Version:
- t.4
- Author:
- Eric Angeli
- See Also:
- Serialized Form
|
Constructor Summary |
LeftRuleBean()
Creates a new instance of LeftRuleBean |
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LeftRuleBean
public LeftRuleBean()
- Creates a new instance of LeftRuleBean
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.