The base container class for a gameplay related object, it's drawable, transformable and components can be added to modify the funcionality. These classes are defined by the user in a json file.
More...
|
|
| GameObject (bool isDef=false) |
| | Constructor, keep in mind this is called when creating a gameObject definition as well as an instance. Definitions are loaded in memory as simple gameObjects so they can be instantiated using the copy constructor and std::make_shared()
|
| |
| | GameObject (const GameObject &other) |
| | Copy constructor More...
|
| |
|
void | init () |
| | Calls init() for every component in this gameObject and itself
|
| |
| void | update (const float &dt, const float &elapsedTime) |
| | Runs the update loop for every component in this gameObject and itself More...
|
| |
| void | networkSerialize (PDEPacket &output) |
| | Called every time an object is sent to a client More...
|
| |
| void | networkDeserialize (PDEPacket &input) |
| | Called every time an object is recieved from a client More...
|
| |
| void | networkSerializeInit (PDEPacket &output) |
| | Called when an object is sent to the clients for the first time More...
|
| |
| void | networkDeserializeInit (PDEPacket &input) |
| | Called when an object is recieved on a client for the first time More...
|
| |
| void | draw (sf::RenderTarget &target, sf::RenderStates states) const |
| | Drawcall, never call explicitly More...
|
| |
| void | loadDefinition (const std::string &filename) |
| | Loads a gameObject definition from a json file More...
|
| |
| void | registerComponentHierarchy (std::shared_ptr< GameObject > self) |
| | Adds the gameObject pointer as the parent for each component this object owns More...
|
| |
|
bool | isDefinition () const |
| |
|
void | setIsDefinition (bool isDef) |
| |
|
int | getZlayer () const |
| |
|
void | setZlayer (int zLayer) |
| |
|
void | addChild (std::shared_ptr< GameObject > gameObject) |
| |
|
void | setParent (std::shared_ptr< GameObject > gameObject) |
| |
|
void | setIsUI (bool isUI) |
| |
|
bool | getIsUI () const |
| |
|
void | setConnection (std::shared_ptr< Connection > conn) |
| |
|
std::shared_ptr< Connection > | getConnection () const |
| |
|
std::shared_ptr< GameObject > | getParent () |
| |
|
void | setAlreadyReplicated (bool replicated) |
| |
|
std::string | getId () const |
| |
|
void | setId (const std::string &id) |
| |
|
void | setName (const std::string &name) |
| |
|
void | destroySelf () |
| |
|
std::string | getType () const |
| |
|
void | setType (const std::string &type) |
| |
|
bool | getDestroyed () const |
| |
|
std::vector< std::shared_ptr< GameObject > > | getChildren () const |
| |
|
void | setNetworked (bool networked) |
| |
|
bool | getNetworked () |
| |
|
void | setHasBeenSent (const std::string &id) |
| |
|
bool | getHasBeenSent (const std::string &id) const |
| |
|
void | sortChildZ () |
| | Makes sure children are in the correct Z order for drawing
|
| |
|
template<typename T > |
| std::shared_ptr< T > | findComponentOfType () const |
| |
| void | onDeath () |
| |
| void | onDamage (float currentHP) |
| |
|
| Alive () |
| | Constructor
|
| |
| void | damage (float damageAmount) |
| | Deals damage and checks for death More...
|
| |
|
float | getHealth () const |
| |
|
void | setHealth (float hp) |
| |
| virtual void | networkSerializeInit (PDEPacket &output)=0 |
| | Called when an object is sent to the clients for the first time More...
|
| |
| virtual void | networkDeserializeInit (PDEPacket &input)=0 |
| | Called when an object is recieved on a client for the first time More...
|
| |
| virtual void | networkSerialize (PDEPacket &output)=0 |
| | Called every time an object is sent to a client More...
|
| |
| virtual void | networkDeserialize (PDEPacket &input)=0 |
| | Called every time an object is recieved from a client More...
|
| |
The base container class for a gameplay related object, it's drawable, transformable and components can be added to modify the funcionality. These classes are defined by the user in a json file.