C++ Joueur Client
 All Classes Namespaces Functions Variables
cpp_client::newtonian::Player Class Reference

A player in this game. Every AI controls one player. More...

#include <player.hpp>

Inheritance diagram for cpp_client::newtonian::Player:
cpp_client::newtonian::Game_object cpp_client::Base_object

Public Member Functions

void log (const std::string &message)
 adds a message to this _game_object's logs. _intended for your own debugging purposes, as strings stored here are saved in the gamelog. More...
 
template<typename T >
std::shared_ptr< typename
T::element_type > 
as ()
 Dynamically casts this object to another type. Returns nullptr if it cannot be converted to the type. More...
 
template<typename T >
bool is ()
 Determines if this object is of the specified object type More...
 

Public Attributes

const std::string & client_type
 What type of client this is, e.g. 'Python', 'JavaScript', or some other language. For potential data mining purposes. More...
 
const std::vector< Tile > & generator_tiles
 Every generator Tile owned by this Player. (listed from the outer edges inward, from top to bottom). More...
 
const int & heat
 The amount of heat this Player has. More...
 
const int & intern_spawn
 The time left till a intern spawns. (0 to spawnTime). More...
 
const bool & lost
 If the player lost the game or not. More...
 
const int & manager_spawn
 The time left till a manager spawns. (0 to spawnTime). More...
 
const std::string & name
 The name of the player. More...
 
const Playeropponent
 This player's opponent in the game. More...
 
const int & physicist_spawn
 The time left till a physicist spawns. (0 to spawnTime). More...
 
const int & pressure
 The amount of pressure this Player has. More...
 
const std::string & reason_lost
 The reason why the player lost the game. More...
 
const std::string & reason_won
 The reason why the player won the game. More...
 
const std::vector< Tile > & spawn_tiles
 All the tiles this Player's units can spawn on. (listed from the outer edges inward, from top to bottom). More...
 
const double & time_remaining
 The amount of time (in ns) remaining for this AI to send commands. More...
 
const std::vector< Unit > & units
 Every Unit owned by this Player. More...
 
const bool & won
 If the player won the game or not. More...
 
const std::string & game_object_name
 String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data. More...
 
const std::string & id
 A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set. More...
 
const std::vector< std::string > & logs
 Any strings logged will be stored here. Intended for debugging. More...
 

Detailed Description

A player in this game. Every AI controls one player.

Member Function Documentation

template<typename T >
std::shared_ptr<typename T::element_type> cpp_client::Base_object::as ( )
inlineinherited

Dynamically casts this object to another type. Returns nullptr if it cannot be converted to the type.

Returns
A pointer to the desired type, or nullptr if it could not be converted
template<typename T >
bool cpp_client::Base_object::is ( )
inlineinherited

Determines if this object is of the specified object type

Returns
true if the object is the object type, false otherwise
void cpp_client::newtonian::Game_object::log ( const std::string &  message)
inherited

adds a message to this _game_object's logs. _intended for your own debugging purposes, as strings stored here are saved in the gamelog.

Parameters
messageA string to add to this GameObject's log. Intended for debugging.

Member Data Documentation

const std::string& cpp_client::newtonian::Player::client_type

What type of client this is, e.g. 'Python', 'JavaScript', or some other language. For potential data mining purposes.

const std::string& cpp_client::newtonian::Game_object::game_object_name
inherited

String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data.

const std::vector<Tile>& cpp_client::newtonian::Player::generator_tiles

Every generator Tile owned by this Player. (listed from the outer edges inward, from top to bottom).

const int& cpp_client::newtonian::Player::heat

The amount of heat this Player has.

const std::string& cpp_client::newtonian::Game_object::id
inherited

A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set.

const int& cpp_client::newtonian::Player::intern_spawn

The time left till a intern spawns. (0 to spawnTime).

const std::vector<std::string>& cpp_client::newtonian::Game_object::logs
inherited

Any strings logged will be stored here. Intended for debugging.

const bool& cpp_client::newtonian::Player::lost

If the player lost the game or not.

const int& cpp_client::newtonian::Player::manager_spawn

The time left till a manager spawns. (0 to spawnTime).

const std::string& cpp_client::newtonian::Player::name

The name of the player.

const Player& cpp_client::newtonian::Player::opponent

This player's opponent in the game.

const int& cpp_client::newtonian::Player::physicist_spawn

The time left till a physicist spawns. (0 to spawnTime).

const int& cpp_client::newtonian::Player::pressure

The amount of pressure this Player has.

const std::string& cpp_client::newtonian::Player::reason_lost

The reason why the player lost the game.

const std::string& cpp_client::newtonian::Player::reason_won

The reason why the player won the game.

const std::vector<Tile>& cpp_client::newtonian::Player::spawn_tiles

All the tiles this Player's units can spawn on. (listed from the outer edges inward, from top to bottom).

const double& cpp_client::newtonian::Player::time_remaining

The amount of time (in ns) remaining for this AI to send commands.

const std::vector<Unit>& cpp_client::newtonian::Player::units

Every Unit owned by this Player.

const bool& cpp_client::newtonian::Player::won

If the player won the game or not.


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