LibNRG  0.0.1
Networking for Real-time Games library
 All Classes Files Functions Variables Friends
nrg::Input< CRTP > Struct Template Reference

Abstract class using the Curiously Recurring Template Pattern that users should inherit from and insert Fields into that represent user-input.

#include <nrg_input.h>

Inheritance diagram for nrg::Input< CRTP >:
nrg::InputBase nrg::FieldContainer

Public Member Functions

void addPredictionFunc (std::function< void(CRTP &)> &&func)
 NYI: Adds a function that is called client-side each frame to predict a Field's value before it is confirmed by the Server.
 
void doPrediction ()
 NYI: Do prediction of inputs client-side.
 
- Public Member Functions inherited from nrg::InputBase
void markUpdated (bool b)
 
bool readFromPacket (Packet &p)
 
void writeToPacket (Packet &p) const
 
virtual void onUpdate (Player &player)=0
 Virtual function called Server-side when the Player player has sent some new input.
 

Additional Inherited Members

- Protected Member Functions inherited from nrg::FieldContainer
 FieldContainer ()
 Standard Constructor.
 
 FieldContainer (const FieldContainer &copy)
 Copy Constructor.
 
FieldContaineroperator= (const FieldContainer &copy)
 Assignment Operator.
 
FieldBasegetFirstField () const
 Return the first field in this FieldContainer's internal linked-list.
 
size_t getNumFields () const
 Returns the number of fields in this FieldContainer's linked-list.
 

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