C++ Joueur Client
 All Classes Namespaces Functions Variables
cpp_client::necrowar::Tower Class Reference

A tower in the game. Used to combat enemy waves. More...

#include <tower.hpp>

Inheritance diagram for cpp_client::necrowar::Tower:
cpp_client::necrowar::Game_object cpp_client::Base_object

Public Member Functions

bool attack (const Tile &tile)
 attacks an enemy unit on an tile within it's range. 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 bool & attacked
 Whether this tower has attacked this turn or not. More...
 
const int & cooldown
 How many turns are left before it can fire again. More...
 
const int & health
 How much remaining health this tower has. More...
 
const Tower_jobjob
 What type of tower this is (it's job). More...
 
const Playerowner
 The player that built / owns this tower. More...
 
const Tiletile
 The Tile this Tower 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 tower in the game. Used to combat enemy waves.

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
bool cpp_client::necrowar::Tower::attack ( const Tile tile)

attacks an enemy unit on an tile within it's range.

Parameters
tileThe Tile to attack.
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::necrowar::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 bool& cpp_client::necrowar::Tower::attacked

Whether this tower has attacked this turn or not.

const int& cpp_client::necrowar::Tower::cooldown

How many turns are left before it can fire again.

const std::string& cpp_client::necrowar::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::necrowar::Tower::health

How much remaining health this tower has.

const std::string& cpp_client::necrowar::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 Tower_job& cpp_client::necrowar::Tower::job

What type of tower this is (it's job).

const std::vector<std::string>& cpp_client::necrowar::Game_object::logs
inherited

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

const Player& cpp_client::necrowar::Tower::owner

The player that built / owns this tower.

const Tile& cpp_client::necrowar::Tower::tile

The Tile this Tower is on.


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