|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.helper.Helper | +--org.moyoman.helper.board.rules.RulesHelper | +--org.moyoman.helper.board.rules.rulesimpl.RulesImpl
This class determines what type of rules helper is to be used. The Board module can use this class, and then this class acts as a proxy to pass through the calls to the rules helper of the appropriate rules type, such as Chinese.
Field Summary | |
private RulesHelper |
rh
The RulesHelper object for the specific rules set for this game. |
Fields inherited from class org.moyoman.helper.Helper |
|
Constructor Summary | |
RulesImpl(GameId gid,
Mode mode,
HelperName hname,
Component parent)
Create the RulesImpl object. |
Method Summary | |
Object |
clone()
Override the Object.clone() method. |
boolean |
doCountPointsInSeki()
Determine if territory in a seki is counted. |
Set |
findPrisoners(Board board)
Find the prisoners which need to be removed from the board. |
boolean |
freePlacementOfHandicapStones()
Determine if handicap stones must be place in a set pattern. |
Debug[] |
getDebugInformation(DebugType[] dt)
Get the debug information for this helper. |
DebugType[] |
getDebugTypes()
Get the debug types that this helper supports. |
Stone |
getKo()
Get the move that would be illegal due to immediately retaking the ko. |
float |
getKomi()
Get the komi. |
short |
getLegalityStatus(NumberedStone ns,
Board board)
Determine the status of the given move. |
ModuleType[] |
getRequiredModuleList()
Get the modules which this helper requires. |
Rules |
getRules()
Get the rules for this game. |
Stone[] |
getSuicide()
Get the moves which would be illegal due to suicide on the next move. |
Stone[] |
getSuperKo()
Get the move that would be illegal because of recreating a whole board position. |
boolean |
isBentFourDeadByRule()
Determine if the bent four group is dead by rule, or must be played out. |
boolean |
isLegalMove(NumberedStone ns,
Board board)
Determine if the given move is legal. |
boolean |
isSuicideAllowed()
Determine if suicide is allowed. |
boolean |
isTerritoryScoring()
Determine if territory (Japanese) or area (Chinese) scoring is used. |
void |
makeMove(Board board)
Update the RulesHelper with the latest move. |
boolean |
mustWhiteMoveLast()
Determine if white must move last. |
short |
numberOfPassesToEndGame()
Determine the number of consecutive passes that ends the game. |
short |
superKoRule()
Determine the type of super ko rule which is in effect. |
Methods inherited from class org.moyoman.helper.Helper |
checkTime, create, createHelper, debug, error, error, fatal, fatal, getAllHelpers, getHelper, getHelperName, getId, getMode, getModule, getParent, getScheduler, information, setTime, warning, warning |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private RulesHelper rh
Constructor Detail |
public RulesImpl(GameId gid, Mode mode, HelperName hname, Component parent) throws InternalErrorException
gid
- The game idmode
- The mode of the game.hname
- The helper name for the specific rules set.parent
- The Board module.
InternalErrorException
- Thrown if the operation fails for any reason.Method Detail |
public boolean doCountPointsInSeki()
doCountPointsInSeki
in class RulesHelper
public boolean freePlacementOfHandicapStones()
freePlacementOfHandicapStones
in class RulesHelper
public float getKomi()
getKomi
in class RulesHelper
public boolean isBentFourDeadByRule()
isBentFourDeadByRule
in class RulesHelper
public boolean isSuicideAllowed()
isSuicideAllowed
in class RulesHelper
public boolean isTerritoryScoring()
isTerritoryScoring
in class RulesHelper
public boolean mustWhiteMoveLast()
mustWhiteMoveLast
in class RulesHelper
public short numberOfPassesToEndGame()
numberOfPassesToEndGame
in class RulesHelper
public short superKoRule()
superKoRule
in class RulesHelper
public Stone[] getSuicide()
getSuicide
in class RulesHelper
public Stone getKo()
getKo
in class RulesHelper
public Stone[] getSuperKo()
getSuperKo
in class RulesHelper
public boolean isLegalMove(NumberedStone ns, Board board)
isLegalMove
in class RulesHelper
ns
- The move being tested.board
- The Board object with the current board position.
public short getLegalityStatus(NumberedStone ns, Board board)
getLegalityStatus
in class RulesHelper
ns
- The move being tested.board
- The Board object with the current board position.
public Debug[] getDebugInformation(DebugType[] dt)
getDebugInformation
in class Helper
dt
- The types of debug information which are supported.
public DebugType[] getDebugTypes()
getDebugTypes
in class Helper
public void makeMove(Board board)
makeMove
in class RulesHelper
board
- The Board object which contains the state of the board.public Set findPrisoners(Board board)
findPrisoners
in class RulesHelper
board
- The Board object with the current state of the board with prisoners still present.
public ModuleType[] getRequiredModuleList()
getRequiredModuleList
in class Helper
public Rules getRules()
getRules
in class RulesHelper
public Object clone()
clone
in class Helper
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |