Package net.royalur.lut
Interface GameStateEncoding
- All Known Implementing Classes:
FinkelGameStateEncoding
,SimpleGameStateEncoding
public interface GameStateEncoding
Encodes the state of a game to a small binary key.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
calcLowerKey
(long key) Gets the lower 32 bits of the given key.static int
calcUpperKey
(long key) Gets the upper 32 bits of the given key.static GameStateEncoding
createSimple
(GameSettings settings) Creates an encoding for a simple set of rules.long
Encode the given game state to a binary key.default long
encodeSymmetricalGameState
(FastSimpleGame game, FastSimpleGame tempGame) Encode the given game state to a binary key that is always encoded as the light player.
-
Method Details
-
encodeGameState
Encode the given game state to a binary key.- Parameters:
game
- The game to encode.- Returns:
- The game state encoded as a binary key.
-
encodeSymmetricalGameState
Encode the given game state to a binary key that is always encoded as the light player. States where it is the dark player's turn will be reversed before being encoded. If a temp game is not provided, and it is the dark player's turn, then a temp game will be constructed.- Parameters:
game
- The game to encode.tempGame
- An optional temporary game to use to reverse the players in game.- Returns:
- The game state encoded as a symmetrical binary key.
-
calcUpperKey
static int calcUpperKey(long key) Gets the upper 32 bits of the given key. -
calcLowerKey
static int calcLowerKey(long key) Gets the lower 32 bits of the given key. -
createSimple
Creates an encoding for a simple set of rules.
-