Platform Data Engine 0.0.1
A data-driven game engine for platformers
|
The base component class, when creating components to add gameplay functionality, they should inherit from this class More...
#include <Component.h>
Public Member Functions | |
virtual void | copy (std::shared_ptr< Component > otherCompPtr) |
Essentially a copy constructor except the generic shared pointer must be converted to the derived type using std::dynamic_pointer_cast More... | |
void | registerHierarchy (GameObject *parent) |
virtual void | init () |
Called once on startup More... | |
virtual void | update (const float &dt, const float &elapsedTime) |
Called every update cycle More... | |
virtual void | draw (sf::RenderTarget &target, sf::RenderStates states) const |
Called every draw cycle More... | |
virtual void | networkSerializeInit (PDEPacket &output) |
Called when sending data for the first time More... | |
virtual void | networkDeserializeInit (PDEPacket &input) |
Called when recieving data for the first time More... | |
virtual void | networkSerialize (PDEPacket &output) |
Use this function to serialize any members you want replicated this is handy for animation components that should copy their state to all client instances More... | |
virtual void | networkDeserialize (PDEPacket &input) |
Use this function to deserialize data coming from the server for this specific client More... | |
virtual void | loadDefinition (nlohmann::json object) |
Called when game object definitions are loaded More... | |
std::string | getType () const |
nlohmann::json | getProps () const |
void | setType (const std::string &type) |
void | setProps (nlohmann::json &props) |
void | setIsDefinition (bool isDef) |
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... | |
Protected Attributes | |
std::map< std::string, nlohmann::json > | m_properties |
GameObject * | m_parent |
bool | m_isDefinition |
nlohmann::json | m_all_props |
std::string | m_type |
The base component class, when creating components to add gameplay functionality, they should inherit from this class
|
virtual |
Essentially a copy constructor except the generic shared pointer must be converted to the derived type using std::dynamic_pointer_cast
otherCompPtr |
Reimplemented in PlatformDataEngine::AnimationController, PlatformDataEngine::Bullet, PlatformDataEngine::CharacterController, PlatformDataEngine::MiniGun, PlatformDataEngine::ParticleSystem, PlatformDataEngine::PhysicsBody, PlatformDataEngine::Projectile, PlatformDataEngine::RocketLauncher, PlatformDataEngine::RocketProjectile, PlatformDataEngine::Spike, PlatformDataEngine::SpriteRenderer, PlatformDataEngine::StatsPanel, PlatformDataEngine::TextRenderer, PlatformDataEngine::TimedDestroy, PlatformDataEngine::Weapon, and PlatformDataEngine::DamageHandler.
|
virtual |
Called every draw cycle
target | |
states |
Reimplemented in PlatformDataEngine::AnimationController, PlatformDataEngine::Bullet, PlatformDataEngine::CharacterController, PlatformDataEngine::ListMenu, PlatformDataEngine::Menu, PlatformDataEngine::ParticleSystem, PlatformDataEngine::PhysicsBody, PlatformDataEngine::Projectile, PlatformDataEngine::RocketProjectile, PlatformDataEngine::Spike, PlatformDataEngine::SpriteRenderer, PlatformDataEngine::StatsPanel, PlatformDataEngine::TextRenderer, PlatformDataEngine::TimedDestroy, PlatformDataEngine::Weapon, and PlatformDataEngine::DamageHandler.
|
virtual |
Called once on startup
Reimplemented in PlatformDataEngine::AnimationController, PlatformDataEngine::Bullet, PlatformDataEngine::CharacterController, PlatformDataEngine::ListMenu, PlatformDataEngine::Menu, PlatformDataEngine::ParticleSystem, PlatformDataEngine::PhysicsBody, PlatformDataEngine::Projectile, PlatformDataEngine::RocketProjectile, PlatformDataEngine::Spike, PlatformDataEngine::SpriteRenderer, PlatformDataEngine::StatsPanel, PlatformDataEngine::TextRenderer, PlatformDataEngine::TimedDestroy, PlatformDataEngine::Weapon, and PlatformDataEngine::DamageHandler.
|
virtual |
Called when game object definitions are loaded
object |
Reimplemented in PlatformDataEngine::AnimationController, PlatformDataEngine::Bullet, PlatformDataEngine::CharacterController, PlatformDataEngine::ParticleSystem, PlatformDataEngine::PhysicsBody, PlatformDataEngine::Projectile, PlatformDataEngine::RocketProjectile, PlatformDataEngine::Spike, PlatformDataEngine::SpriteRenderer, PlatformDataEngine::StatsPanel, PlatformDataEngine::TextRenderer, PlatformDataEngine::TimedDestroy, PlatformDataEngine::Weapon, and PlatformDataEngine::DamageHandler.
|
virtual |
Use this function to deserialize data coming from the server for this specific client
input |
Implements PlatformDataEngine::Networkable.
Reimplemented in PlatformDataEngine::AnimationController, PlatformDataEngine::PhysicsBody, PlatformDataEngine::SpriteRenderer, and PlatformDataEngine::Weapon.
|
virtual |
Called when recieving data for the first time
input |
Implements PlatformDataEngine::Networkable.
|
virtual |
Use this function to serialize any members you want replicated this is handy for animation components that should copy their state to all client instances
output |
Implements PlatformDataEngine::Networkable.
Reimplemented in PlatformDataEngine::AnimationController, PlatformDataEngine::PhysicsBody, PlatformDataEngine::SpriteRenderer, and PlatformDataEngine::Weapon.
|
virtual |
Called when sending data for the first time
output |
Implements PlatformDataEngine::Networkable.
|
virtual |
Called every update cycle
dt | delta time |
elapsedTime | elapsed time |
Reimplemented in PlatformDataEngine::AnimationController, PlatformDataEngine::Bullet, PlatformDataEngine::CharacterController, PlatformDataEngine::EngineStatsText, PlatformDataEngine::ListMenu, PlatformDataEngine::Menu, PlatformDataEngine::MiniGun, PlatformDataEngine::ParticleSystem, PlatformDataEngine::PhysicsBody, PlatformDataEngine::Projectile, PlatformDataEngine::RocketLauncher, PlatformDataEngine::RocketProjectile, PlatformDataEngine::Spike, PlatformDataEngine::SpriteRenderer, PlatformDataEngine::StatsPanel, PlatformDataEngine::TextRenderer, PlatformDataEngine::TimedDestroy, PlatformDataEngine::Weapon, and PlatformDataEngine::DamageHandler.