A Miner in the game.
More...
#include <miner.hpp>
|
bool | build (const Tile &tile, const std::string &type) |
| builds a support, shield, or ladder on _miner's _tile, or an adjacent _tile. More...
|
|
bool | buy (const std::string &resource, int amount) |
| purchase a resource from the _player's base or hopper. More...
|
|
bool | dump (const Tile &tile, const std::string &material, int amount) |
| dumps materials from cargo to an adjacent _tile. _if the _tile is a base or a hopper _tile, materials are sold instead of placed. More...
|
|
bool | mine (const Tile &tile, int amount) |
| mines the _tile the _miner is on or an adjacent _tile. More...
|
|
bool | move (const Tile &tile) |
| moves this _miner from its current _tile to an adjacent _tile. More...
|
|
bool | transfer (const Miner &miner, const std::string &resource, int amount) |
| transfers a resource from the one _miner to another. More...
|
|
bool | upgrade () |
| upgrade this _miner by installing an upgrade module. 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::coreminer::Miner::build |
( |
const Tile & |
tile, |
|
|
const std::string & |
type |
|
) |
| |
builds a support, shield, or ladder on _miner's _tile, or an adjacent _tile.
- Parameters
-
tile | The Tile to build on. |
type | The structure to build (support, ladder, or shield). |
bool cpp_client::coreminer::Miner::buy |
( |
const std::string & |
resource, |
|
|
int |
amount |
|
) |
| |
purchase a resource from the _player's base or hopper.
- Parameters
-
resource | The type of resource to buy. |
amount | The amount of resource to buy. Amounts <= 0 will buy all of that material Player can. |
bool cpp_client::coreminer::Miner::dump |
( |
const Tile & |
tile, |
|
|
const std::string & |
material, |
|
|
int |
amount |
|
) |
| |
dumps materials from cargo to an adjacent _tile. _if the _tile is a base or a hopper _tile, materials are sold instead of placed.
- Parameters
-
tile | The Tile the materials will be dumped on. |
material | The material the Miner will drop. 'dirt', 'ore', or 'bomb'. |
amount | The number of materials to drop. Amounts <= 0 will drop all of the material. |
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::coreminer::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::coreminer::Miner::mine |
( |
const Tile & |
tile, |
|
|
int |
amount |
|
) |
| |
mines the _tile the _miner is on or an adjacent _tile.
- Parameters
-
tile | The Tile the materials will be mined from. |
amount | The amount of material to mine up. Amounts <= 0 will mine all the materials that the Miner can. |
bool cpp_client::coreminer::Miner::move |
( |
const Tile & |
tile | ) |
|
moves this _miner from its current _tile to an adjacent _tile.
- Parameters
-
bool cpp_client::coreminer::Miner::transfer |
( |
const Miner & |
miner, |
|
|
const std::string & |
resource, |
|
|
int |
amount |
|
) |
| |
transfers a resource from the one _miner to another.
- Parameters
-
miner | The Miner to transfer materials to. |
resource | The type of resource to transfer. |
amount | The amount of resource to transfer. Amounts <= 0 will transfer all the of the material. |
bool cpp_client::coreminer::Miner::upgrade |
( |
| ) |
|
upgrade this _miner by installing an upgrade module.
const int& cpp_client::coreminer::Miner::bombs |
The number of bombs being carried by this Miner.
const int& cpp_client::coreminer::Miner::building_materials |
The number of building materials carried by this Miner.
const Upgrade& cpp_client::coreminer::Miner::current_upgrade |
const int& cpp_client::coreminer::Miner::dirt |
The amount of dirt carried by this Miner.
const std::string& cpp_client::coreminer::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::coreminer::Miner::health |
The remaining health of this Miner.
const std::string& cpp_client::coreminer::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::coreminer::Game_object::logs |
|
inherited |
Any strings logged will be stored here. Intended for debugging.
const int& cpp_client::coreminer::Miner::mining_power |
The remaining mining power this Miner has this turn.
const int& cpp_client::coreminer::Miner::moves |
The number of moves this Miner has left this turn.
const int& cpp_client::coreminer::Miner::ore |
The amount of ore carried by this Miner.
const Player& cpp_client::coreminer::Miner::owner |
const Tile& cpp_client::coreminer::Miner::tile |
const int& cpp_client::coreminer::Miner::upgrade_level |
The upgrade level of this Miner. Starts at 0.
The documentation for this class was generated from the following file: