C++ Joueur Client
 All Classes Namespaces Functions Variables
cpp_client::saloon::Young_gun Class Reference

An eager young person that wants to join your gang, and will call in the veteran Cowboys you need to win the brawl in the saloon. More...

#include <young_gun.hpp>

Inheritance diagram for cpp_client::saloon::Young_gun:
cpp_client::saloon::Game_object cpp_client::Base_object

Public Member Functions

Cowboy call_in (const std::string &job)
 tells the _young_gun to call in a new _cowboy of the given job to the open _tile nearest to them. 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 Tilecall_in_tile
 The Tile that a Cowboy will be called in on if this YoungGun calls in a Cowboy. More...
 
const bool & can_call_in
 True if the YoungGun can call in a Cowboy, false otherwise. More...
 
const Playerowner
 The Player that owns and can control this YoungGun. More...
 
const Tiletile
 The Tile this YoungGun is currently 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

An eager young person that wants to join your gang, and will call in the veteran Cowboys you need to win the brawl in the saloon.

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
Cowboy cpp_client::saloon::Young_gun::call_in ( const std::string &  job)

tells the _young_gun to call in a new _cowboy of the given job to the open _tile nearest to them.

Parameters
jobThe job you want the Cowboy being brought to have.
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::saloon::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 Tile& cpp_client::saloon::Young_gun::call_in_tile

The Tile that a Cowboy will be called in on if this YoungGun calls in a Cowboy.

const bool& cpp_client::saloon::Young_gun::can_call_in

True if the YoungGun can call in a Cowboy, false otherwise.

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

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

const Player& cpp_client::saloon::Young_gun::owner

The Player that owns and can control this YoungGun.

const Tile& cpp_client::saloon::Young_gun::tile

The Tile this YoungGun is currently on.


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