A beaver in the game.
More...
#include <beaver.hpp>
|
bool | attack (const Beaver &beaver) |
| attacks another adjacent beaver. More...
|
|
bool | build_lodge () |
| builds a lodge on the _beavers current _tile. More...
|
|
bool | drop (const Tile &tile, const std::string &resource, int amount=0) |
| drops some of the given resource on the beaver's _tile. More...
|
|
bool | harvest (const Spawner &spawner) |
| harvests the branches or food from a _spawner on an adjacent _tile. More...
|
|
bool | move (const Tile &tile) |
| moves this _beaver from its current _tile to an adjacent _tile. More...
|
|
bool | pickup (const Tile &tile, const std::string &resource, int amount=0) |
| picks up some branches or food on the beaver's tile. 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...
|
|
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
bool cpp_client::stumped::Beaver::attack |
( |
const Beaver & |
beaver | ) |
|
attacks another adjacent beaver.
- Parameters
-
beaver | The Beaver to attack. Must be on an adjacent Tile. |
bool cpp_client::stumped::Beaver::build_lodge |
( |
| ) |
|
builds a lodge on the _beavers current _tile.
bool cpp_client::stumped::Beaver::drop |
( |
const Tile & |
tile, |
|
|
const std::string & |
resource, |
|
|
int |
amount = 0 |
|
) |
| |
drops some of the given resource on the beaver's _tile.
- Parameters
-
tile | The Tile to drop branches/food on. Must be the same Tile that the Beaver is on, or an adjacent one. |
resource | The type of resource to drop ('branches' or 'food'). |
amount | The amount of the resource to drop, numbers <= 0 will drop all the resource type. |
bool cpp_client::stumped::Beaver::harvest |
( |
const Spawner & |
spawner | ) |
|
harvests the branches or food from a _spawner on an adjacent _tile.
- Parameters
-
spawner | The Spawner you want to harvest. Must be on an adjacent Tile. |
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::stumped::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::stumped::Beaver::move |
( |
const Tile & |
tile | ) |
|
moves this _beaver from its current _tile to an adjacent _tile.
- Parameters
-
bool cpp_client::stumped::Beaver::pickup |
( |
const Tile & |
tile, |
|
|
const std::string & |
resource, |
|
|
int |
amount = 0 |
|
) |
| |
picks up some branches or food on the beaver's tile.
- Parameters
-
tile | The Tile to pickup branches/food from. Must be the same Tile that the Beaver is on, or an adjacent one. |
resource | The type of resource to pickup ('branches' or 'food'). |
amount | The amount of the resource to drop, numbers <= 0 will pickup all of the resource type. |
const int& cpp_client::stumped::Beaver::actions |
The number of actions remaining for the Beaver this turn.
const int& cpp_client::stumped::Beaver::branches |
The amount of branches this Beaver is holding.
const int& cpp_client::stumped::Beaver::food |
The amount of food this Beaver is holding.
const std::string& cpp_client::stumped::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::stumped::Beaver::health |
How much health this Beaver has left.
const std::string& cpp_client::stumped::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 Job& cpp_client::stumped::Beaver::job |
const std::vector<std::string>& cpp_client::stumped::Game_object::logs |
|
inherited |
Any strings logged will be stored here. Intended for debugging.
const int& cpp_client::stumped::Beaver::moves |
How many moves this Beaver has left this turn.
const Player& cpp_client::stumped::Beaver::owner |
const bool& cpp_client::stumped::Beaver::recruited |
True if the Beaver has finished being recruited and can do things, False otherwise.
const Tile& cpp_client::stumped::Beaver::tile |
const int& cpp_client::stumped::Beaver::turns_distracted |
Number of turns this Beaver is distracted for (0 means not distracted).
The documentation for this class was generated from the following file: