rules
Class DownLeftRuleBean
java.lang.Object
rules.AbRuleBean
rules.DownLeftRuleBean
- All Implemented Interfaces:
- java.io.Serializable
public class DownLeftRuleBean
- extends AbRuleBean
- implements java.io.Serializable
Created on November 3, 2006, 9:03 PM
Defines the rule for checking and flipping pieces in diagonal direction, down and left.
- Version:
- t.4
- Author:
- Eric Angeli
- See Also:
- Serialized Form
|
Constructor Summary |
DownLeftRuleBean()
Creates a new instance of DownLeftRuleBean |
|
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 |
DownLeftRuleBean
public DownLeftRuleBean()
- Creates a new instance of DownLeftRuleBean
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.