SuperTuxKart
|
Public Member Functions | |
Rewinder (const std::string &ui="") | |
virtual void | saveTransform ()=0 |
Called before a rewind. | |
virtual void | computeError ()=0 |
Called when a rewind is finished, and is used to compute the error caused by the rewind (which is then visually smoothed over time). | |
virtual BareNetworkString * | saveState (std::vector< std::string > *ru)=0 |
Provides a copy of the state of the object in one memory buffer. | |
virtual void | undoEvent (BareNetworkString *buffer)=0 |
Called when an event needs to be undone. | |
virtual void | rewindToEvent (BareNetworkString *buffer)=0 |
Called when an event needs to be replayed. | |
virtual void | restoreState (BareNetworkString *buffer, int count)=0 |
Called when a state needs to be replayed. | |
virtual void | undoState (BareNetworkString *buffer)=0 |
Undo the effects of the given state, but do not rewind to that state (which is done by rewindTo). | |
virtual void | reset () |
Nothing to do here. | |
virtual std::function< void()> | getLocalStateRestoreFunction () |
const std::string & | getUniqueIdentity () const |
bool | rewinderAdd () |
Add this object to the list of all rewindable objects in the rewind manager. | |
template<typename T > | |
std::shared_ptr< T > | getShared () |
Protected Member Functions | |
void | setUniqueIdentity (const std::string &uid) |
Private Attributes | |
std::string | m_unique_identity |
Currently it has 2 usages: | |
|
pure virtual |
Called when a rewind is finished, and is used to compute the error caused by the rewind (which is then visually smoothed over time).
Implemented in CTFFlag, DummyRewinder, PhysicalObject, Flyable, NetworkItemManager, and KartRewinder.
|
inlinevirtual |
Nothing to do here.
Reimplemented in PhysicalObject, Flyable, NetworkItemManager, and KartRewinder.
|
pure virtual |
Called when a state needs to be replayed.
This is called during rewind, i.e. when going forward in time again, and only for confirmed states.
Implemented in CTFFlag, PhysicalObject, Flyable, NetworkItemManager, Plunger, RubberBall, KartRewinder, and DummyRewinder.
|
pure virtual |
Called when an event needs to be replayed.
This is called during rewind, i.e. when going forward in time again.
Implemented in NetworkItemManager, CTFFlag, PhysicalObject, Flyable, KartRewinder, and DummyRewinder.
|
pure virtual |
Provides a copy of the state of the object in one memory buffer.
The memory is managed by the RewindManager.
[out] | ru | The unique identity of rewinder writing to. |
Implemented in CTFFlag, DummyRewinder, PhysicalObject, Flyable, NetworkItemManager, Plunger, RubberBall, and KartRewinder.
|
pure virtual |
Called before a rewind.
Is used to save the previous position of an object before a rewind, so that the error due to a rewind can be computed.
Implemented in CTFFlag, DummyRewinder, PhysicalObject, Flyable, NetworkItemManager, and KartRewinder.
|
pure virtual |
Called when an event needs to be undone.
This is called while going backwards for rewinding - all stored events will get an 'undo' call.
Implemented in NetworkItemManager, CTFFlag, PhysicalObject, Flyable, KartRewinder, and DummyRewinder.
|
pure virtual |
Undo the effects of the given state, but do not rewind to that state (which is done by rewindTo).
This is called while going backwards for rewinding - all stored events will get an 'undo' call.
Implemented in CTFFlag, PhysicalObject, Flyable, NetworkItemManager, KartRewinder, and DummyRewinder.
|
private |
Currently it has 2 usages: