|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.module.Module | +--org.moyoman.module.dame.dameimpl.DameImpl
This module implements the Dame interface. Currently, the algorithm is fairly simple, and only empty points which are adjacent to both black and white stones and are legal moves for the current side are identified. In the future, life and death issues will need to be taken into account.
Field Summary | |
private HashSet |
dame
The dame points. |
private static DebugType[] |
dt
The debug types that this module supports. |
private static ModuleType[] |
mt
The modules upon which this module depends. |
Fields inherited from class org.moyoman.module.Module |
|
Constructor Summary | |
DameImpl(GameId id,
ModuleName name)
Create a DameImpl object. |
Method Summary | |
boolean |
canPointBePlayed(Point pt)
Checks if the given dame Point pt can be played. |
Object |
clone()
Clone the module. |
void |
generateMove(Module[] modules)
Compute all dame points. |
Set |
getDamePoints()
Returns all dame points on the board. |
Debug[] |
getDebugInformation(DebugType[] types)
Return the debug information for this module. |
DebugType[] |
getDebugTypes()
Get the debug types that this module supports. |
RatedMove[] |
getMoves()
Returns an empty array as dame points are by definition not worth playing. |
ModuleType[] |
getRequiredModuleList()
Get the module types used by this module. |
boolean |
isDamePoint(Point pt)
Checks if the given Point pt is a dame point. |
private boolean |
isDamePointHelper(Stone st,
Board board)
Computes if the given point is dame. |
void |
makeMove(Move move,
Module[] modules)
Invalidates the dame points that were computed for the previous move. |
Methods inherited from class org.moyoman.module.Module |
checkTime, create, createHelper, debug, error, error, fatal, fatal, getAllHelpers, getHelper, getId, getKomi, getModule, getModuleName, getScheduler, information, setTime, warning, warning |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.moyoman.module.ModuleInterface |
getScheduler |
Field Detail |
private static ModuleType[] mt
private static DebugType[] dt
private HashSet dame
Constructor Detail |
public DameImpl(GameId id, ModuleName name) throws InternalErrorException
id
- The game id.name
- The name of this module.
InternalErrorException
- Thrown if an error occurs for any reason.Method Detail |
private boolean isDamePointHelper(Stone st, Board board)
false
will be
returned.
st
- The point that we are looking at.public boolean isDamePoint(Point pt)
isDamePoint
in interface Dame
pt
- The point in question.
public boolean canPointBePlayed(Point pt) throws IllegalArgumentException
canPointBePlayed
in interface Dame
pt
- The dame point in question.
IllegalArgumentException
- Thrown if the
point is not a dame point.public Set getDamePoints()
getDamePoints
in interface Dame
public void generateMove(Module[] modules) throws InternalErrorException
generateMove
in class Module
modules
- An array of modules which this module needs
in order to perform its work. Those modules reflect the
current state of the board but are copies of the actual modules,
so this method is free to manipulate them.
InternalErrorException
public Debug[] getDebugInformation(DebugType[] types)
Module
getDebugInformation
in class Module
types
- The debug types that the caller knows how to handle.
public DebugType[] getDebugTypes()
getDebugTypes
in class Module
public RatedMove[] getMoves()
getMoves
in interface ModuleInterface
getMoves
in class Module
public ModuleType[] getRequiredModuleList()
getRequiredModuleList
in class Module
public void makeMove(Move move, Module[] modules) throws IllegalMoveException, InternalErrorException
makeMove
in class Module
move
- The move that was just made.modules
- The modules that this method needs to perform its job.
IllegalMoveException
InternalErrorException
public Object clone()
ModuleInterface
clone
in interface ModuleInterface
clone
in class Module
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |