|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectklaus.backend.NullBackend
public class NullBackend
This is a default backend implementing basic actions (setActive/setInactive) and ignoring most of the input. Other backends should extend this instead of implementing ChessBackend.
Field Summary | |
---|---|
protected boolean |
active
|
protected long |
blackTime
|
private Vector<MoveListener> |
moveListeners
|
private Vector<ResultListener> |
resultListeners
|
protected long |
whiteTime
|
Constructor Summary | |
---|---|
NullBackend()
|
Method Summary | |
---|---|
boolean |
addMove(Move move)
Add a certain move to the backend. |
void |
addMoveListener(MoveListener listener)
Add a move listener. |
void |
addResultListener(ResultListener listener)
|
void |
fireMoveListeners(Move move)
|
void |
fireResultListeners(Result result)
|
long |
getBlackTime()
Gives the remaining time for black [im milliseconds] |
Party |
getParty()
|
Position |
getPosition()
|
long |
getWhiteTime()
Gives the remaining time for white [in milliseconds] |
boolean |
isGameRunning()
|
void |
removeMoveListener(MoveListener listener)
Remove a move listener |
void |
removeResultListener(ResultListener listener)
|
void |
setActive()
Set the backend active (let it accept new moves). |
void |
setInactive()
Set the backend inactive (see #setActive for more information) |
void |
setPosition(Position position)
Sets the backend position to the given position. |
void |
unload()
Unload the backend, e. g. close file/database/process connections |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long whiteTime
protected long blackTime
protected boolean active
private Vector<MoveListener> moveListeners
private Vector<ResultListener> resultListeners
Constructor Detail |
---|
public NullBackend()
Method Detail |
---|
public boolean addMove(Move move)
ChessBackend
addMove
in interface ChessBackend
move
- the move that has been done by the user
public void setActive()
ChessBackend
setActive
in interface ChessBackend
public void setInactive()
ChessBackend
setInactive
in interface ChessBackend
public void setPosition(Position position)
ChessBackend
setPosition
in interface ChessBackend
position
- the given positionpublic void addMoveListener(MoveListener listener)
ChessBackend
addMoveListener
in interface ChessBackend
public void removeMoveListener(MoveListener listener)
ChessBackend
removeMoveListener
in interface ChessBackend
public void fireMoveListeners(Move move)
fireMoveListeners
in interface ChessBackend
public void addResultListener(ResultListener listener)
addResultListener
in interface ChessBackend
public void removeResultListener(ResultListener listener)
removeResultListener
in interface ChessBackend
public void fireResultListeners(Result result)
fireResultListeners
in interface ChessBackend
public void unload()
ChessBackend
unload
in interface ChessBackend
public long getBlackTime()
ChessBackend
getBlackTime
in interface ChessBackend
public long getWhiteTime()
ChessBackend
getWhiteTime
in interface ChessBackend
public Party getParty()
getParty
in interface ChessBackend
public Position getPosition()
getPosition
in interface ChessBackend
public boolean isGameRunning()
isGameRunning
in interface ChessBackend
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |