penguins  1.0.0
Player Struct Reference

Detailed Description

Holds the data of the players of the Game.

You shouldn't create instances of this struct yourself, they are allocated by game_set_players_count.

Definition at line 68 of file game.h.

Data Fields

short id
 The unique ID, usually (but not necessarily) is just index + 1. More...
 
char * name
 Use game_set_player_name to set this. More...
 
int points
 The score of the player, i.e. the number of collected fish. More...
 
int penguins_count
 The length of the penguins array. More...
 
Coordspenguins
 The list of the positions of all of the player's penguins. More...
 
int moves_count
 The number of moves (penguin placements and movements) made by the player. More...
 
int color
 The color of the penguins, currently used only in the TUI. More...
 

Field Documentation

◆ id

◆ name

char* Player::name

◆ points

◆ penguins_count

◆ penguins

Coords* Player::penguins

The list of the positions of all of the player's penguins.

Note
Must be kept in sync with the board when setting penguin tiles!

Definition at line 79 of file game.h.

Referenced by Game::any_valid_player_move_exists(), BotState::bot_compute_move(), Game::game_add_player_penguin(), Game::game_clone(), Game::game_compute_state_hash(), Game::game_find_player_penguin(), Game::game_remove_player_penguin(), Game::game_set_penguins_per_player(), and Game::game_set_players_count().

◆ moves_count

int Player::moves_count

The number of moves (penguin placements and movements) made by the player.

Definition at line 81 of file game.h.

Referenced by Game::game_compute_state_hash(), Game::game_set_players_count(), GameEndDialog::GameEndDialog(), Game::move_penguin(), Game::place_penguin(), Game::undo_move_penguin(), and Game::undo_place_penguin().

◆ color

int Player::color

The color of the penguins, currently used only in the TUI.

Definition at line 83 of file game.h.

Referenced by display_new_turn_message(), Game::game_set_players_count(), print_board(), print_player_stats(), and run_interactive_mode().


The documentation for this struct was generated from the following file: