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

Steal from merchants and become the most infamous pirate. More...

#include <game.hpp>

Inheritance diagram for cpp_client::pirates::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 double & bury_interest_rate
 The rate buried gold increases each turn. More...
 
const int & crew_cost
 How much gold it costs to construct a single crew. More...
 
const int & crew_damage
 How much damage crew deal to each other. More...
 
const int & crew_health
 The maximum amount of health a crew member can have. More...
 
const int & crew_moves
 The number of moves Units with only crew are given each turn. More...
 
const double & crew_range
 A crew's attack range. Range is circular. 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 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 double & heal_factor
 How much health a Unit recovers when they rest. 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 double & merchant_gold_rate
 How much gold merchant Ports get each turn. More...
 
const double & merchant_interest_rate
 When a merchant ship spawns, the amount of additional gold it has relative to the Port's investment. More...
 
const double & min_interest_distance
 The Euclidean distance buried gold must be from the Player's Port to accumulate interest. More...
 
const std::vector< Player > & players
 List of all the players in the game. More...
 
const std::vector< Port > & ports
 Every Port in the game. Merchant ports have owner set to null. More...
 
const double & rest_range
 How far a Unit can be from a Port to rest. Range is circular. More...
 
const std::string & session
 A unique identifier for the game instance that is being played. More...
 
const int & ship_cost
 How much gold it costs to construct a ship. More...
 
const int & ship_damage
 How much damage ships deal to ships and ports. More...
 
const int & ship_health
 The maximum amount of health a ship can have. More...
 
const int & ship_moves
 The number of moves Units with ships are given each turn. More...
 
const double & ship_range
 A ship's attack range. Range is circular. 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...
 
const std::vector< Unit > & units
 Every Unit in the game. Merchant units have targetPort set to a port. More...
 

Detailed Description

Steal from merchants and become the most infamous pirate.

Member Function Documentation

Tile cpp_client::pirates::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 double& cpp_client::pirates::Game::bury_interest_rate

The rate buried gold increases each turn.

const int& cpp_client::pirates::Game::crew_cost

How much gold it costs to construct a single crew.

const int& cpp_client::pirates::Game::crew_damage

How much damage crew deal to each other.

const int& cpp_client::pirates::Game::crew_health

The maximum amount of health a crew member can have.

const int& cpp_client::pirates::Game::crew_moves

The number of moves Units with only crew are given each turn.

const double& cpp_client::pirates::Game::crew_range

A crew's attack range. Range is circular.

const Player& cpp_client::pirates::Game::current_player

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

const int& cpp_client::pirates::Game::current_turn

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

const std::unordered_map<std::string, Game_object>& cpp_client::pirates::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 double& cpp_client::pirates::Game::heal_factor

How much health a Unit recovers when they rest.

const int& cpp_client::pirates::Game::map_height

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

const int& cpp_client::pirates::Game::map_width

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

const int& cpp_client::pirates::Game::max_turns

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

const double& cpp_client::pirates::Game::merchant_gold_rate

How much gold merchant Ports get each turn.

const double& cpp_client::pirates::Game::merchant_interest_rate

When a merchant ship spawns, the amount of additional gold it has relative to the Port's investment.

const double& cpp_client::pirates::Game::min_interest_distance

The Euclidean distance buried gold must be from the Player's Port to accumulate interest.

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

List of all the players in the game.

const std::vector<Port>& cpp_client::pirates::Game::ports

Every Port in the game. Merchant ports have owner set to null.

const double& cpp_client::pirates::Game::rest_range

How far a Unit can be from a Port to rest. Range is circular.

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

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

const int& cpp_client::pirates::Game::ship_cost

How much gold it costs to construct a ship.

const int& cpp_client::pirates::Game::ship_damage

How much damage ships deal to ships and ports.

const int& cpp_client::pirates::Game::ship_health

The maximum amount of health a ship can have.

const int& cpp_client::pirates::Game::ship_moves

The number of moves Units with ships are given each turn.

const double& cpp_client::pirates::Game::ship_range

A ship's attack range. Range is circular.

const std::vector<Tile>& cpp_client::pirates::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::pirates::Game::time_added_per_turn

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

const std::vector<Unit>& cpp_client::pirates::Game::units

Every Unit in the game. Merchant units have targetPort set to a port.


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