47 virtual uint16_t
getType()
const = 0;
50 uint16_t
getID()
const {
return nrg_id; }
65 void markUpdated(
bool updated);
66 double getInterpTimer()
const;
68 void setID(
int id){ nrg_id = id; }
70 EntityManager* getManager()
const {
return manager; }
72 void setManager(EntityManager* m){ manager = m; }
78 EntityManager* manager;
85 virtual void markEntityUpdated(
Entity& e){}
86 virtual void unregisterEntity(
Entity& e){}
87 virtual double getInterpTimer()
const {
return 1.0; }
88 virtual bool supportsPrediction()
const {
return false; }
89 virtual InputBase* getInput()
const {
return nullptr; }
93 template<
class T, u
int16_t type>
96 virtual uint16_t
getType()
const {
return type; }
virtual nrg::Entity * clone()
Returns an identical copy of the derived class of this Entity.
Definition: nrg_entity.h:95
Abstract class to be inherited by users of the library which acts as a container of one or more Field...
Definition: nrg_entity.h:37
Abstract class that contains functionality required by Entity objects.
Definition: nrg_entity.h:84
virtual uint16_t getType() const
Returns this entity's user-defined type identifier.
Definition: nrg_entity.h:96
uint16_t getID() const
Returns this Entity's ID assigned by the library.
Definition: nrg_entity.h:50
Entity()
Default Constructor.
virtual Entity * clone()=0
Returns an identical copy of the derived class of this Entity.
virtual void onCreate(Client &c)
Virtual function called on the client-side when the Entity is created.
Definition: nrg_entity.h:54
virtual void onUpdate(Client &c)
Virtual function called on the client-side when the Entity is updated.
Definition: nrg_entity.h:58
Helper template class that automatically implements the Entity::clone and Entity::getType methods...
Definition: nrg_entity.h:94
Contains classes related to the Field template class that encapsulates data to be replicated across t...
virtual void onDestroy(Client &c)
Virtual function called on the client-side just before the Entity is destroyed.
Definition: nrg_entity.h:56
The main client-side nrg class.
Definition: nrg_client.h:42
Abstract class used by anything that contains Fields, like Entity or InputBase.
Definition: nrg_field.h:81
Common defines and includes used by all the other nrg header files.
virtual uint16_t getType() const =0
Returns this entity's user-defined type identifier.
virtual ~Entity()
Standard Destructor.