Crate scout_game

Crate scout_game 

Source

Structs§

Card
A card, this stores two values, however only the first is “active”. Implements flip(), a convenience method which simply flips the two values.
GameResult
GameState
Stores information about the whole game. This implements game logic to process actions and check scores. It is also responsible for generating GameView objects from the perspective of the current player (self.turn)
GameView
View from perspective of single player. This is rotated, so vectors such as score may not align with the “true” indexes in GameState
Player
Each player has a hand, score, and their “Scout show” move.

Enums§

Action
Player actions. These are Scout, Show and ScoutShow, which each take different parameters.
NewGameView
Result of taking an action on a GameView. This may end the game, resulting in Win or Loss.

Traits§

Strategy
Strategy trait implements get_action method to generates an Action based on a GameView. These can include user input, but are mostly computer players. Returning None will halt the current game.

Functions§

default_set_map
Generate the default set hierarchy for the deck of 0-9 valued cards
get_valid_actions
Return all valid Actions for view. For a large hand this will include approximately:
run
Run a single game of Scout. The length of strategies determines the number of players, and the Strategy function each player uses.
watch
Watch a single game of Scout. The length of strategies determines the number of players, and the Strategy function each player uses.

Type Aliases§

SetMap
To efficiently compare the value of sets, this hashmap is created.