|
Holger's Java API |
|||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||
| Packages that use GameMove | |
|---|---|
| com.antelmann.game | This package contains packages to support game implementations. |
| com.antelmann.game.awari | This package contains an implementation of the game Awari. |
| com.antelmann.game.card | This package contains classes to serve card games and also includes a full implementation of BlackJack. |
| com.antelmann.game.checkers | This package contains an implementation of the game checkers. |
| com.antelmann.game.chess | This package contains an implementation of the game chess. |
| com.antelmann.game.fourwins | This package contains a reference implementation of the game Four-Connects or 4-wins or 4-in-a-row. |
| com.antelmann.game.gomoku | This package contains an implementation of the game Go-moku. |
| com.antelmann.game.mine | This package contains an implementation of the game MineSweeper. |
| com.antelmann.game.muehle | This package contains a reference implementation of the game "Mühle" (as it is known in German) or "Nine Men's Morris". |
| com.antelmann.game.puzzle | This package contains single-user game implementations representing puzzles. |
| com.antelmann.game.reversi | This package contains an implementation of the game Reversi or Othello. |
| com.antelmann.game.ttt | This package simply contains an implementation of the game Tick Tack Toe. |
| com.antelmann.game.wolfsheep | This package contains an implementation of the game Wolf&Sheep. |
| Uses of GameMove in com.antelmann.game |
|---|
| Classes in com.antelmann.game that implement GameMove | |
|---|---|
class |
GameBoardMove
A specialized GameMove class suitable for board games to implement moves of pieces from and to positions on a board. |
class |
MoveTemplate
MoveTemplate just provides a skeleton implementation for the GameMove interface, so you can focus soley on
the game specific properties of the GameMove. |
| Methods in com.antelmann.game that return GameMove | |
|---|---|
GameMove |
GameDriver.autoMove()
autoMove() makes the move based on heuristics given by the Player; the time taken by the Player to evaluate the move will effect the time kept for that Player. |
GameMove |
AutoPlay.autoMove()
autoMove() carries out the next best move for the game and returns it; null is returned if no move was carried out. |
protected GameMove |
TemplatePlayer.Synchronizer.getBestMove()
|
GameMove |
AbstractGame.getLastMove()
getLastMove() is a convenience function which returns the last element of the GameMove[] from getMoveHistory() in case the array has any elements in it; null is returned otherwise. |
GameMove[] |
GamePlay.getLegalMoves()
returns an array containing all moves that can be legally performed with the current game status; each move should successfully be able to advance the game when called with makeMove(). |
GameMove[] |
AbstractGame.getLegalMoves()
Instead of overriding this (final) function, implement listLegalMoves() instead. |
GameMove[] |
AbstractGame.getLegalMoves(int playerRole)
getLegalMoves(playerRole) returns the subset of getLegalMoves() where player == move.getPlayer(). |
static GameMove[] |
GameUtilities.getLegalMovesSorted(GamePlay game,
Player player,
int[] roles,
boolean descending)
getLegalMovesSorted() sorts the legal moves of the given game descending or ascending by their heuristic calculated by the given player based on the roles. |
GameMove[] |
GamePlay.getMoveHistory()
returns an array containing all moves that have been applied to the current game status; the last move that was applied is the last move in the array at index (getMoveHistory().length-1) |
GameMove[] |
AbstractGame.getMoveHistory()
|
GameMove |
GameDriver.getRandomLegalMove()
|
GameMove |
AutoPlay.getRandomLegalMove()
returns a random legal move or null if no legal moves are available |
GameMove[] |
GamePlay.getRedoList()
returns an array containing all moves that have been taken back and could be reapplied; the GameMove at the index 0 is the next object that can be reapplied. |
GameMove[] |
AbstractGame.getRedoList()
|
GameMove |
GameDriver.hint(int playerRole)
hint() interfaces with the Player object that corresponds to the game role of this game. |
GameMove |
AutoPlay.hint(int playerRole)
hint(int) delegates the evaluation of the best move to make to the Player object associated to the playerRole. |
protected abstract GameMove[] |
AbstractGame.listLegalMoves()
listLegalMoves() returns the legal moves for this game. |
GameMove |
GameDriver.makeRandomMove()
|
GameMove |
TemplatePlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
This implementation selects the best move according to the given configuration. |
GameMove |
SocketPlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
|
GameMove |
Player.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
selectMove() asks the Player to select a move out of GamePlay.legalMove() based on the role it plays; milliseconds is an indication of how long the calling function is willing to wait for an answer before continuing with potentially a randomMove or something else. |
GameMove |
BookPlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
first checks the embedded book for a pre-stored move |
| Methods in com.antelmann.game with parameters of type GameMove | |
|---|---|
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
boolean orderMoves)
This function implements Alpha-Beta Search algorithm (intelligently pruned MinMax algorithm) and returns the evaluation given by the player's heuristic functions at the leaves; limited only by deepening level. |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
double alpha,
double beta,
boolean orderMoves)
This function is usually just called by the other corresponding alphaBetaSearch function. |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
double alpha,
double beta,
long time,
boolean orderMoves)
This function is usually just called by the other timed alphaBetaSearch function. |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
double alpha,
double beta,
Monitor monitor,
boolean orderMoves)
This function is usually just called by the other corresponding monitored alphaBetaSearch function. |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
long time,
boolean orderMoves)
This function implements Alpha-Beta Search algorithm (intelligently pruned MinMax algorithm) and returns the evaluation given by the player's heuristic functions at the leaves - timed version (search cut off at given time). |
static double |
GameUtilities.alphaBetaSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
Monitor monitor,
boolean orderMoves)
This function implements Alpha-Beta Search algorithm and returns the evaluation given by the player's heuristic functions at the leaves (intelligently pruned MinMax algorithm) - monitor version (search is cut off when monitor disabled). |
double |
TemplatePlayer.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds)
This method will simply call the protected evaluate() method and in addition track the call if tracking is enabled. |
double |
SocketPlayer.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds)
|
double |
Player.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds)
evaluate() asks the Player to rate a move in the context of a given game stage relative to its role (if the Player has multiple roles in the game, they will all be found in the role array - giving the Player maximum flexibility) while considering the game level for potential game tree search operations and then using heuristic() to evaluate the leaves of the game tree. |
double |
BookPlayer.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds)
|
protected double |
TemplatePlayer.evaluate(GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds,
Monitor monitor)
Internal evaluate function called by public evaluate() and selectMove(). |
double |
GameDriver.evaluateMove(GameMove move)
This function interfaces with the Player and returns the value of evaluate() while passing on the response time; note that a call to this function does not effect the time kept for the Player in the game. |
double |
AutoPlay.evaluateMove(GameMove move)
The evaluation of the move is usually carried out by the Player object who plays the given move; consequently, the result should be interpreted from the perspective of the game roles this particular Player plays in the game. |
double |
SocketPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
double |
RandomPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
Preserves the knowlege of whether the move wins or looses the game only if getCheckForWin() returns true; return values are then randomized unless the random seed is set to 0. |
double |
Player.heuristic(GamePlay game,
GameMove move,
int[] role)
This function - often used as a callback function - evaluates the given move in the context of the given game; it is expected to return quickly. |
double |
BookPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
boolean |
GamePlay.isLegalMove(GameMove move)
This function is needed for games where getLegalMoves() may not return a complete list of all possible moves (so that a determination on whether the given move is legal could simply be made by checking whether the move is included in the array returned by getLegalMoves()); then, isLegalMoves() will make the determination whether the given move is legal. |
boolean |
AbstractGame.isLegalMove(GameMove move)
this implementation checks whether the move is contained in the array returned by getLegalMoves(); thus this method relies on GameMove.equals() being implemented properly for the move in question |
boolean |
GamePlay.makeMove(GameMove move)
If the move is successfully carried out, the function returns true, false otherwise. |
boolean |
AbstractGame.makeMove(GameMove move)
|
static double |
GameUtilities.minMaxSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level)
implements MinMax Search algorithm and returns the evaluation given by the player's heuristic functions at the leaves; limited only by a deepening level |
static double |
GameUtilities.minMaxSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
long time)
implements MinMax Search algorithm and returns the evaluation given by the player's heuristic functions at the leaves; will only run as deep as given by the level and only as long as given time is less than System.currentTimeMillis(). |
static double |
GameUtilities.minMaxSearch(GamePlay game,
GameMove move,
Player player,
int[] role,
int level,
Monitor monitor)
implements MinMax Search algorithm and returns the evaluation given by the player's heuristic functions at the leaves; tracking is enabled tracking through a Monitor object. |
boolean |
TemplatePlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
unless overridden, this method returns always false |
boolean |
SocketPlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
|
boolean |
Player.pruneMove(GamePlay game,
GameMove move,
int[] role)
This method allows the Player to prune a game tree branch by determining that a particular move is not to be considered for further recursive tree search; this method is expected to return quickly. |
boolean |
BookPlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
|
protected abstract boolean |
AbstractGame.pushMove(GameMove move)
pushMove takes a GameMove and alters the game according to to the move. |
protected void |
TemplatePlayer.Synchronizer.report(GameMove move,
double heuristic)
|
boolean |
JPlayerClient.requestGUIMove(GameMove move)
|
boolean |
JGameFrame.requestGUIMove(GameMove move)
|
boolean |
GameGUI.requestGUIMove(GameMove move)
requestGUIMove() is called when a JGamePlay container registered a move to be made throug the GUI; this move is then passed to the game playing frame through this method - allowing the main frame to decide what is to be done |
GamePlay |
GamePlay.spawnChild(GameMove move)
spawnChild returns a deep copy of an identical game that represents the status of the game after the given move is carried out. |
GamePlay |
AbstractGame.spawnChild(GameMove move)
spawnChild() creates a clone of the current game and advances the game by the given GameMove. |
| Method parameters in com.antelmann.game with type arguments of type GameMove | |
|---|---|
void |
BookPlayer.setBook(Hashtable<GamePlay,GameMove> book)
Sets the internal book used by this BookPlayer. |
| Constructors in com.antelmann.game with parameters of type GameMove | |
|---|---|
TemplatePlayer.MoveEvaluater(TemplatePlayer.Synchronizer synch,
GamePlay game,
GameMove move,
int[] role,
int level,
long milliseconds,
Monitor monitor)
|
|
| Uses of GameMove in com.antelmann.game.awari |
|---|
| Methods in com.antelmann.game.awari that return GameMove | |
|---|---|
protected GameMove[] |
AwariGame.listLegalMoves()
|
| Methods in com.antelmann.game.awari with parameters of type GameMove | |
|---|---|
double |
AwariPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
protected boolean |
AwariGame.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.card |
|---|
| Methods in com.antelmann.game.card that return GameMove | |
|---|---|
protected GameMove[] |
BlackJack.listLegalMoves()
|
| Methods in com.antelmann.game.card with parameters of type GameMove | |
|---|---|
double |
BJPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
double |
BJCheater.heuristic(GamePlay game,
GameMove move,
int[] role)
|
protected boolean |
BlackJack.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.checkers |
|---|
| Methods in com.antelmann.game.checkers that return GameMove | |
|---|---|
protected GameMove[] |
CheckersGame.listLegalMoves()
|
| Methods in com.antelmann.game.checkers with parameters of type GameMove | |
|---|---|
double |
CheckersPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
seems effective for the opening, but not sufficiently discriminating in the end game |
protected boolean |
CheckersGame.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.chess |
|---|
| Methods in com.antelmann.game.chess that return GameMove | |
|---|---|
GameMove[] |
ChessGame.listLegalMoves()
|
| Methods in com.antelmann.game.chess with parameters of type GameMove | |
|---|---|
double |
ChessPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
this heuristic still needs some major work; it only looks at piece value at this point |
protected boolean |
ChessGame.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.fourwins |
|---|
| Methods in com.antelmann.game.fourwins that return GameMove | |
|---|---|
protected GameMove[] |
FourWinsGame.listLegalMoves()
|
GameMove |
FourWinsPlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
|
| Methods in com.antelmann.game.fourwins with parameters of type GameMove | |
|---|---|
double |
FourWinsPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
protected boolean |
FourWinsGame.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.gomoku |
|---|
| Methods in com.antelmann.game.gomoku that return GameMove | |
|---|---|
protected GameMove[] |
GomokuGame.listLegalMoves()
|
| Methods in com.antelmann.game.gomoku with parameters of type GameMove | |
|---|---|
double |
GomokuPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
boolean |
GomokuPlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
ignore all moves that are either at the edge or have no neighbor |
protected boolean |
GomokuGame.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.mine |
|---|
| Methods in com.antelmann.game.mine that return GameMove | |
|---|---|
protected GameMove[] |
MineSweeper.listLegalMoves()
|
| Methods in com.antelmann.game.mine with parameters of type GameMove | |
|---|---|
protected boolean |
MineSweeper.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.muehle |
|---|
| Methods in com.antelmann.game.muehle that return GameMove | |
|---|---|
protected GameMove[] |
MuehleGame.listLegalMoves()
|
| Methods in com.antelmann.game.muehle with parameters of type GameMove | |
|---|---|
double |
MuehlePlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
boolean |
MuehlePlayer.pruneMove(GamePlay game,
GameMove move,
int[] role)
A move is pruned if capture moves are possible while this is not one of them (with the exception of when the opponent may only have 3 pieces left and may jump). |
protected boolean |
MuehleGame.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.puzzle |
|---|
| Methods in com.antelmann.game.puzzle that return GameMove | |
|---|---|
protected GameMove[] |
WSPuzzle.listLegalMoves()
lists all legal moves. |
protected GameMove[] |
TilePuzzle.listLegalMoves()
|
protected GameMove[] |
Solitaire.listLegalMoves()
|
protected GameMove[] |
EightQueens.listLegalMoves()
|
| Methods in com.antelmann.game.puzzle with parameters of type GameMove | |
|---|---|
double |
TilePuzzlePlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
|
protected boolean |
WSPuzzle.pushMove(GameMove move)
|
protected boolean |
TilePuzzle.pushMove(GameMove move)
|
protected boolean |
Solitaire.pushMove(GameMove move)
|
protected boolean |
EightQueens.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.reversi |
|---|
| Methods in com.antelmann.game.reversi that return GameMove | |
|---|---|
GameMove[] |
ReversiGame.listLegalMoves()
|
| Methods in com.antelmann.game.reversi with parameters of type GameMove | |
|---|---|
double |
ReversiPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
this heuristic is basically counting pieces, but as long as the game is not over, it weights the pieces differently according to their potential for a final win. |
protected boolean |
ReversiGame.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.ttt |
|---|
| Methods in com.antelmann.game.ttt that return GameMove | |
|---|---|
protected GameMove[] |
TickTackToe.listLegalMoves()
|
| Methods in com.antelmann.game.ttt with parameters of type GameMove | |
|---|---|
protected boolean |
TickTackToe.pushMove(GameMove move)
|
| Uses of GameMove in com.antelmann.game.wolfsheep |
|---|
| Methods in com.antelmann.game.wolfsheep that return GameMove | |
|---|---|
protected GameMove[] |
WolfsheepGame.listLegalMoves()
|
GameMove |
WSPlayer.selectMove(GamePlay game,
int[] role,
int level,
long milliseconds)
overridden to provide a sensible opening that doesn't suffer from the horizon effect |
| Methods in com.antelmann.game.wolfsheep with parameters of type GameMove | |
|---|---|
double |
WSPlayer.heuristic(GamePlay game,
GameMove move,
int[] role)
only cares for the first given role in the role array |
protected boolean |
WolfsheepGame.pushMove(GameMove move)
|
|
|
|||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||