LibNRG  0.0.1
Networking for Real-time Games library
 All Classes Files Functions Variables Friends
nrg::Field< T, Cdc > Class Template Reference

Template class encapsulating a type that will be replicated from Server to Clients, and is stored inside a FieldContainer.

#include <nrg_field.h>

Inheritance diagram for nrg::Field< T, Cdc >:
nrg::FieldBase

Public Member Functions

 Field (FieldContainer *c)
 
 Field (FieldContainer *c, const T &t)
 
virtual size_t readFromPacket (Packet &p)
 Reads data from Packet p into this Field.
 
virtual size_t writeToPacket (Packet &p) const
 Writes this Field into the Packet p.
 
virtual void shiftData ()
 Indicates a new Snapshot has begun and the Field should move data_next to data.
 
void set (const T &other)
 Alternative to Field::operator=.
 
Fieldoperator= (const T &other)
 Assignment operator, which also marks this field as having been updated.
 
get () const
 Returns the most up-to-date data without interpolation.
 
template<class F >
getInterp (const F &func) const
 Returns data interpolated between the two latest Snapshots using func.
 
getInterp () const
 Returns data linearly interpolated between the two latest Snapshots using nrg::lerp.
 

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