Index

A B C D E F G H I M N O P R S T V 
All Classes and Interfaces|All Packages

A

AbstractGame<S,T> - Class in game.console
Conducts a two-player game on the console.
AbstractGame(S, Function<String, T>) - Constructor for class game.console.AbstractGame
Creates a Game instance to conduct a two-player game on the console.

B

BreadthFirstSearch<T> - Class in puzzle.solver
Implements the breadth-first search (BFS) algorithm to solve puzzles.
BreadthFirstSearch() - Constructor for class puzzle.solver.BreadthFirstSearch
 

C

clone() - Method in interface puzzle.State
Returns a copy of the state.
clone() - Method in interface puzzle.TwoPhaseMoveState
 
common - package common
Provides classes and interfaces to be shared between puzzles and two-player games.
common.util - package common.util
Provides utilities for puzzles and two-player games.
console - Variable in class game.console.AbstractGame
 

D

DRAW - Enum constant in enum class game.State.Status
 

E

equals(Object) - Method in record class common.TwoPhaseMoveState.TwoPhaseMove
Indicates whether some other object is "equal to" this one.
equals(Object) - Method in class puzzle.solver.Node
 

F

from() - Method in record class common.TwoPhaseMoveState.TwoPhaseMove
Returns the value of the from record component.

G

game - package game
Package for representing and playing two-player games.
Game<T> - Class in game.console
Conducts a two-player game whose moves are described by a single object.
Game(State<T>, Function<String, T>) - Constructor for class game.console.Game
Creates a Game instance to conduct a two-player game whose moves are described by a single object on the console.
game.console - package game.console
Package for playing two-player games on the console.
getFrom() - Method in class common.util.TwoPhaseMoveSelector
Returns the source selected.
getLegalMoves() - Method in interface puzzle.State
Returns the set of all moves that can be applied to the state.
getMove() - Method in class puzzle.solver.Node
Returns the move that created the state from the state of the parent node.
getNextPlayer() - Method in interface game.State
Returns the player who moves next.
getParent() - Method in class puzzle.solver.Node
Returns the parent of the node.
getPhase() - Method in class common.util.TwoPhaseMoveSelector
Returns the current selection phase.
getState() - Method in class puzzle.solver.Node
Returns the state represented by the node.
getStatus() - Method in interface game.State
Returns the status of the game.
getTo() - Method in class common.util.TwoPhaseMoveSelector
Returns the target selected.

H

hashCode() - Method in record class common.TwoPhaseMoveState.TwoPhaseMove
Returns a hash code value for this object.
hashCode() - Method in class puzzle.solver.Node
 
hasNextChild() - Method in class puzzle.solver.Node
Returns whether the node has at least one child node to be created with the Node.nextChild() method.

I

IN_PROGRESS - Enum constant in enum class game.State.Status
 
isGameOver() - Method in interface game.State
Returns whether the game is over.
isInvalidSelection() - Method in class common.util.TwoPhaseMoveSelector
Returns whether the last selection (i.e, for the source or the target, respectively) was invalid.
isLegalMove(T) - Method in interface common.State
Returns whether the move provided can be applied to the state.
isLegalToMoveFrom(T) - Method in interface common.TwoPhaseMoveState
Returns whether it is possible to make a move from the argument specified.
isReadyToMove() - Method in class common.util.TwoPhaseMoveSelector
Returns whether the move is ready to be made.
isSolved() - Method in interface puzzle.State
Returns whether the puzzle is solved.
isWinner(State.Player) - Method in interface game.State
Returns whether the player specified has won the game.

M

makeMove() - Method in class common.util.TwoPhaseMoveSelector
Makes the move selected.
makeMove(T) - Method in interface common.State
Applies the move provided to the state.
makeMoveIfPossible(T) - Method in class game.console.AbstractGame
Applies the move specified to the state of the game if the move is a legal one.
makeMoveIfPossible(T) - Method in class game.console.Game
 
makeMoveIfPossible(T) - Method in class game.console.TwoPhaseMoveGame
 

N

nextChild() - Method in class puzzle.solver.Node
Creates and returns the next child of the node by applying a legal move to the state represented by the node.
Node<T> - Class in puzzle.solver
Represents the nodes of a search graph.
Node(State<T>) - Constructor for class puzzle.solver.Node
Creates a Node without a parent, i.e., a root node.
Node(State<T>, Node<T>, T) - Constructor for class puzzle.solver.Node
Creates a Node with a parent node.

O

opponent() - Method in enum class game.State.Player
Returns the opponent of the player.

P

parser - Variable in class game.console.AbstractGame
 
phase - Variable in class common.util.TwoPhaseMoveSelector
 
PLAYER_1 - Enum constant in enum class game.State.Player
 
PLAYER_1_WINS - Enum constant in enum class game.State.Status
 
PLAYER_2 - Enum constant in enum class game.State.Player
 
PLAYER_2_WINS - Enum constant in enum class game.State.Status
 
printPrompt() - Method in class game.console.AbstractGame
Prints a prompt on the console to read the next move to be made.
printPrompt() - Method in class game.console.TwoPhaseMoveGame
 
printState() - Method in class game.console.AbstractGame
Prints the state of the game on the console.
printStatus() - Method in class game.console.AbstractGame
Prints the status of the game on the console.
puzzle - package puzzle
Package for representing and solving puzzles.
puzzle.solver - package puzzle.solver
Package for solving puzzles.

R

readMove() - Method in class game.console.AbstractGame
Reads the next move to be made from the console.
READY_TO_MOVE - Enum constant in enum class common.util.TwoPhaseMoveSelector.Phase
 
reset() - Method in class common.util.TwoPhaseMoveSelector
Resets the selection, i.e., resets both the source and the target selected.

S

select(T) - Method in class common.util.TwoPhaseMoveSelector
Selects the action specified to be either the source or the target of the move, respectively.
SELECT_FROM - Enum constant in enum class common.util.TwoPhaseMoveSelector.Phase
 
SELECT_TO - Enum constant in enum class common.util.TwoPhaseMoveSelector.Phase
 
selectFrom(T) - Method in class common.util.TwoPhaseMoveSelector
 
selectTo(T) - Method in class common.util.TwoPhaseMoveSelector
 
setPhase(TwoPhaseMoveSelector.Phase) - Method in class common.util.TwoPhaseMoveSelector
Sets the current selection phase.
solve(State<T>) - Method in class puzzle.solver.BreadthFirstSearch
Searches for the shortest solution for the puzzle starting from the state provided.
solveAndPrintSolution(State<T>) - Method in class puzzle.solver.BreadthFirstSearch
Searches for the shortest solution for the puzzle starting from the state provided, and it also prints the solution to the standard output.
start() - Method in class game.console.AbstractGame
Starts the game.
state - Variable in class game.console.AbstractGame
 
State<T> - Interface in common
Represents functionality shared between the state of puzzles and two-player games.
State<T> - Interface in game
Represents the state of a two-player game whose moves are described by a single object.
State<T> - Interface in puzzle
Represents the state of a puzzle to be solved.
State.Player - Enum Class in game
Represents the two players.
State.Status - Enum Class in game
Represents the status of the game.

T

to() - Method in record class common.TwoPhaseMoveState.TwoPhaseMove
Returns the value of the to record component.
toString() - Method in record class common.TwoPhaseMoveState.TwoPhaseMove
Returns a string representation of this record class.
toString() - Method in class puzzle.solver.Node
 
TwoPhaseMove(T, T) - Constructor for record class common.TwoPhaseMoveState.TwoPhaseMove
Creates an instance of a TwoPhaseMove record class.
TwoPhaseMoveGame<T> - Class in game.console
Conducts a two-player game of the two-phase move-type on the console.
TwoPhaseMoveGame(TwoPhaseMoveState<T>, Function<String, T>) - Constructor for class game.console.TwoPhaseMoveGame
Creates a TwoPhaseMoveGame instance to conduct a two-player game of the two-phase move-type on the console.
TwoPhaseMoveSelector<T> - Class in common.util
Utility class to determine the next move in two-phase move-type puzzles or two-player games.
TwoPhaseMoveSelector(TwoPhaseMoveState<T>) - Constructor for class common.util.TwoPhaseMoveSelector
Creates a TwoPhaseMoveSelector object to determine the next move in the state specified.
TwoPhaseMoveSelector.Phase - Enum Class in common.util
Represents the current selection phase.
TwoPhaseMoveState<T> - Interface in common
Represents the states of puzzles or two-player games whose moves are described by two objects, i.e., from and to.
TwoPhaseMoveState<T> - Interface in game
Represents the state of a game whose moves are described by two objects, i.e., from and to.
TwoPhaseMoveState<T> - Interface in puzzle
Represents the state of a puzzle whose moves are described by two objects, i.e., from and to.
TwoPhaseMoveState.TwoPhaseMove<T> - Record Class in common
Represents moves that are described by two objects, i.e., from and to.

V

valueOf(String) - Static method in enum class common.util.TwoPhaseMoveSelector.Phase
Returns the enum constant of this class with the specified name.
valueOf(String) - Static method in enum class game.State.Player
Returns the enum constant of this class with the specified name.
valueOf(String) - Static method in enum class game.State.Status
Returns the enum constant of this class with the specified name.
values() - Static method in enum class common.util.TwoPhaseMoveSelector.Phase
Returns an array containing the constants of this enum class, in the order they are declared.
values() - Static method in enum class game.State.Player
Returns an array containing the constants of this enum class, in the order they are declared.
values() - Static method in enum class game.State.Status
Returns an array containing the constants of this enum class, in the order they are declared.
A B C D E F G H I M N O P R S T V 
All Classes and Interfaces|All Packages