|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.boardgame.chess.action.ChessActionFactory
public class ChessActionFactory
Provides a factory for chess actions.
| Method Summary | |
|---|---|
IGridBoardAction |
getAction(IChessEnvironment board,
IChessAgent agent,
IntegerPosition fromPosition,
IntegerPosition toPosition)
Create and return an action of the type appropriate to the state of the parameters. |
IGridBoardAction |
getAction(IChessEnvironment board,
IChessAgent agent,
IntegerPosition kingFromPosition,
IntegerPosition kingToPosition,
IntegerPosition rookFromPosition,
IntegerPosition rookToPosition)
Create and return an action of the type appropriate to the state of the parameters. |
static ChessActionFactory |
getInstance()
Return the singleton instance. |
protected Class |
getPawnPromotionType(IChessAgent agent)
Return the pawn promotion type desired by the given agent. |
protected boolean |
isPawnPromotionPossible(IChessEnvironment board,
IChessAgent agent,
IntegerPosition fromPosition,
IntegerPosition toPosition)
Return true if a pawn promotion is possible using the given parameters. |
void |
releaseActions(List actions)
Release the actions in the given list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ChessActionFactory getInstance()
public IGridBoardAction getAction(IChessEnvironment board,
IChessAgent agent,
IntegerPosition fromPosition,
IntegerPosition toPosition)
board - Chess environment.agent - Chess agent.fromPosition - From position.toPosition - To position.
public IGridBoardAction getAction(IChessEnvironment board,
IChessAgent agent,
IntegerPosition kingFromPosition,
IntegerPosition kingToPosition,
IntegerPosition rookFromPosition,
IntegerPosition rookToPosition)
board - Chess environment.agent - Chess agent.kingFromPosition - King from position.kingToPosition - King to position.rookFromPosition - Rook from position.rookToPosition - Rook to position.public void releaseActions(List actions)
actions - Actions list.protected Class getPawnPromotionType(IChessAgent agent)
agent - Chess agent.
protected boolean isPawnPromotionPossible(IChessEnvironment board,
IChessAgent agent,
IntegerPosition fromPosition,
IntegerPosition toPosition)
board - Grid board.agent - Agent.fromPosition - From position.toPosition - To position.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |