C++ Joueur Client
 All Classes Namespaces Functions Variables
cpp_client::stardash::Body Class Reference

A celestial body located within the game. More...

#include <body.hpp>

Inheritance diagram for cpp_client::stardash::Body:
cpp_client::stardash::Game_object cpp_client::Base_object

Public Member Functions

int next_x (int num)
 the x value of this body a number of turns from now. (0-how many you want). More...
 
int next_y (int num)
 the x value of this body a number of turns from now. (0-how many you want). More...
 
bool spawn (const double &x, const double &y, const std::string &title)
 spawn a unit on some value of this celestial body. More...
 
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 int & amount
 The amount of material the object has, or energy if it is a planet. More...
 
const std::string & body_type
 The type of celestial body it is. Either 'planet', 'asteroid', or 'sun'. More...
 
const std::string & material_type
 The type of material the celestial body has. Either 'none', 'genarium', 'rarium', 'legendarium', or 'mythicite'. More...
 
const Playerowner
 The Player that owns and can control this Body. More...
 
const double & radius
 The radius of the circle that this body takes up. More...
 
const double & x
 The x value this celestial body is on. More...
 
const double & y
 The y value this celestial body is on. 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 celestial body located within the game.

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::stardash::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.
int cpp_client::stardash::Body::next_x ( int  num)

the x value of this body a number of turns from now. (0-how many you want).

Parameters
numThe number of turns in the future you wish to check.
int cpp_client::stardash::Body::next_y ( int  num)

the x value of this body a number of turns from now. (0-how many you want).

Parameters
numThe number of turns in the future you wish to check.
bool cpp_client::stardash::Body::spawn ( const double &  x,
const double &  y,
const std::string &  title 
)

spawn a unit on some value of this celestial body.

Parameters
xThe x value of the spawned unit.
yThe y value of the spawned unit.
titleThe job title of the unit being spawned.

Member Data Documentation

const int& cpp_client::stardash::Body::amount

The amount of material the object has, or energy if it is a planet.

const std::string& cpp_client::stardash::Body::body_type

The type of celestial body it is. Either 'planet', 'asteroid', or 'sun'.

const std::string& cpp_client::stardash::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::string& cpp_client::stardash::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 std::vector<std::string>& cpp_client::stardash::Game_object::logs
inherited

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

const std::string& cpp_client::stardash::Body::material_type

The type of material the celestial body has. Either 'none', 'genarium', 'rarium', 'legendarium', or 'mythicite'.

const Player& cpp_client::stardash::Body::owner

The Player that owns and can control this Body.

const double& cpp_client::stardash::Body::radius

The radius of the circle that this body takes up.

const double& cpp_client::stardash::Body::x

The x value this celestial body is on.

const double& cpp_client::stardash::Body::y

The y value this celestial body is on.


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