A person on the map that can move around and interact within the saloon.
More...
#include <cowboy.hpp>
|
bool | act (const Tile &tile, const std::string &drunk_direction="") |
| does their job's action on a _tile. More...
|
|
bool | move (const Tile &tile) |
| moves this _cowboy from its current _tile to an adjacent _tile. More...
|
|
bool | play (const Furnishing &piano) |
| sits down and plays a piano. 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...
|
|
|
const bool & | can_move |
| If the Cowboy can be moved this turn via its owner. More...
|
|
const std::string & | drunk_direction |
| The direction this Cowboy is moving while drunk. Will be 'North', 'East', 'South', or 'West' when drunk; or '' (empty string) when not drunk. More...
|
|
const int & | focus |
| How much focus this Cowboy has. Different Jobs do different things with their Cowboy's focus. More...
|
|
const int & | health |
| How much health this Cowboy currently has. More...
|
|
const bool & | is_dead |
| If this Cowboy is dead and has been removed from the game. More...
|
|
const bool & | is_drunk |
| If this Cowboy is drunk, and will automatically walk. More...
|
|
const std::string & | job |
| The job that this Cowboy does, and dictates how they fight and interact within the Saloon. More...
|
|
const Player & | owner |
| The Player that owns and can control this Cowboy. More...
|
|
const Tile & | tile |
| The Tile that this Cowboy is located on. More...
|
|
const int & | tolerance |
| How many times this unit has been drunk before taking their siesta and resetting this to 0. More...
|
|
const int & | turns_busy |
| How many turns this unit has remaining before it is no longer busy and can act() or play() again. 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...
|
|
A person on the map that can move around and interact within the saloon.
bool cpp_client::saloon::Cowboy::act |
( |
const Tile & |
tile, |
|
|
const std::string & |
drunk_direction = "" |
|
) |
| |
does their job's action on a _tile.
- Parameters
-
tile | The Tile you want this Cowboy to act on. |
drunk_direction | The direction the bottle will cause drunk cowboys to be in, can be 'North', 'East', 'South', or 'West'. |
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::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
-
message | A string to add to this GameObject's log. Intended for debugging. |
bool cpp_client::saloon::Cowboy::move |
( |
const Tile & |
tile | ) |
|
moves this _cowboy from its current _tile to an adjacent _tile.
- Parameters
-
bool cpp_client::saloon::Cowboy::play |
( |
const Furnishing & |
piano | ) |
|
sits down and plays a piano.
- Parameters
-
piano | The Furnishing that is a piano you want to play. |
const bool& cpp_client::saloon::Cowboy::can_move |
If the Cowboy can be moved this turn via its owner.
const std::string& cpp_client::saloon::Cowboy::drunk_direction |
The direction this Cowboy is moving while drunk. Will be 'North', 'East', 'South', or 'West' when drunk; or '' (empty string) when not drunk.
const int& cpp_client::saloon::Cowboy::focus |
How much focus this Cowboy has. Different Jobs do different things with their Cowboy's focus.
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 int& cpp_client::saloon::Cowboy::health |
How much health this Cowboy currently has.
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 bool& cpp_client::saloon::Cowboy::is_dead |
If this Cowboy is dead and has been removed from the game.
const bool& cpp_client::saloon::Cowboy::is_drunk |
If this Cowboy is drunk, and will automatically walk.
const std::string& cpp_client::saloon::Cowboy::job |
The job that this Cowboy does, and dictates how they fight and interact within the Saloon.
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::Cowboy::owner |
const Tile& cpp_client::saloon::Cowboy::tile |
const int& cpp_client::saloon::Cowboy::tolerance |
How many times this unit has been drunk before taking their siesta and resetting this to 0.
const int& cpp_client::saloon::Cowboy::turns_busy |
How many turns this unit has remaining before it is no longer busy and can act()
or play()
again.
The documentation for this class was generated from the following file: