C++ Joueur Client
 All Classes Namespaces Functions Variables
cpp_client::stumped::Game Class Reference

Gather branches and build up your lodge as beavers fight to survive. More...

#include <game.hpp>

Inheritance diagram for cpp_client::stumped::Game:

Public Member Functions

Tile get_tile_at (const int x, const int y)
 Gets the Tile at a specified (x, y) position More...
 

Public Attributes

const std::vector< Beaver > & beavers
 Every Beaver in the game. More...
 
const Playercurrent_player
 The player whose turn it is currently. That player can send commands. Other players cannot. More...
 
const int & current_turn
 The current turn number, starting at 0 for the first player's turn. More...
 
const int & free_beavers_count
 When a Player has less Beavers than this number, then recruiting other Beavers is free. More...
 
const std::unordered_map
< std::string, Game_object > & 
game_objects
 A mapping of every game object's ID to the actual game object. Primarily used by the server and client to easily refer to the game objects via ID. More...
 
const std::vector< Job > & jobs
 All the Jobs that Beavers can have in the game. More...
 
const double & lodge_cost_constant
 Constant number used to calculate what it costs to spawn a new lodge. More...
 
const int & lodges_to_win
 How many lodges must be owned by a Player at once to win the game. More...
 
const int & map_height
 The number of Tiles in the map along the y (vertical) axis. More...
 
const int & map_width
 The number of Tiles in the map along the x (horizontal) axis. More...
 
const int & max_turns
 The maximum number of turns before the game will automatically end. More...
 
const std::vector< Player > & players
 List of all the players in the game. More...
 
const std::string & session
 A unique identifier for the game instance that is being played. More...
 
const std::vector< Spawner > & spawner
 Every Spawner in the game. More...
 
const double & spawner_harvest_constant
 Constant number used to calculate how many branches/food Beavers harvest from Spawners. More...
 
const std::vector< std::string > & spawner_types
 All the types of Spawners in the game. More...
 
const std::vector< Tile > & tiles
 All the tiles in the map, stored in Row-major order. Use x + y * mapWidth to access the correct index. More...
 
const int & time_added_per_turn
 The amount of time (in nano-seconds) added after each player performs a turn. More...
 

Detailed Description

Gather branches and build up your lodge as beavers fight to survive.

Member Function Documentation

Tile cpp_client::stumped::Game::get_tile_at ( const int  x,
const int  y 
)

Gets the Tile at a specified (x, y) position

Parameters
xinteger between 0 and the mapWidth
yinteger between 0 and the mapHeight
Returns
the Tile at (x, y) or null if out of bounds

Member Data Documentation

const std::vector<Beaver>& cpp_client::stumped::Game::beavers

Every Beaver in the game.

const Player& cpp_client::stumped::Game::current_player

The player whose turn it is currently. That player can send commands. Other players cannot.

const int& cpp_client::stumped::Game::current_turn

The current turn number, starting at 0 for the first player's turn.

const int& cpp_client::stumped::Game::free_beavers_count

When a Player has less Beavers than this number, then recruiting other Beavers is free.

const std::unordered_map<std::string, Game_object>& cpp_client::stumped::Game::game_objects

A mapping of every game object's ID to the actual game object. Primarily used by the server and client to easily refer to the game objects via ID.

const std::vector<Job>& cpp_client::stumped::Game::jobs

All the Jobs that Beavers can have in the game.

const double& cpp_client::stumped::Game::lodge_cost_constant

Constant number used to calculate what it costs to spawn a new lodge.

const int& cpp_client::stumped::Game::lodges_to_win

How many lodges must be owned by a Player at once to win the game.

const int& cpp_client::stumped::Game::map_height

The number of Tiles in the map along the y (vertical) axis.

const int& cpp_client::stumped::Game::map_width

The number of Tiles in the map along the x (horizontal) axis.

const int& cpp_client::stumped::Game::max_turns

The maximum number of turns before the game will automatically end.

const std::vector<Player>& cpp_client::stumped::Game::players

List of all the players in the game.

const std::string& cpp_client::stumped::Game::session

A unique identifier for the game instance that is being played.

const std::vector<Spawner>& cpp_client::stumped::Game::spawner

Every Spawner in the game.

const double& cpp_client::stumped::Game::spawner_harvest_constant

Constant number used to calculate how many branches/food Beavers harvest from Spawners.

const std::vector<std::string>& cpp_client::stumped::Game::spawner_types

All the types of Spawners in the game.

const std::vector<Tile>& cpp_client::stumped::Game::tiles

All the tiles in the map, stored in Row-major order. Use x + y * mapWidth to access the correct index.

const int& cpp_client::stumped::Game::time_added_per_turn

The amount of time (in nano-seconds) added after each player performs a turn.


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