SuperTuxKart
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
CTFFlag Class Reference
Inheritance diagram for CTFFlag:
Inheritance graph
[legend]

Public Member Functions

 CTFFlag (FlagColor fc, const btTransform &base_trans)
 
virtual void saveTransform ()
 Called before a rewind. More...
 
virtual void computeError ()
 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)
 Provides a copy of the state of the object in one memory buffer. More...
 
virtual void undoEvent (BareNetworkString *buffer)
 Called when an event needs to be undone. More...
 
virtual void rewindToEvent (BareNetworkString *buffer)
 Called when an event needs to be replayed. More...
 
virtual void restoreState (BareNetworkString *buffer, int count)
 Called when a state needs to be replayed. More...
 
virtual void undoState (BareNetworkString *buffer)
 Undo the effects of the given state, but do not rewind to that state (which is done by rewindTo). More...
 
int getHolder () const
 
int getStatus () const
 
const Vec3 & getOrigin () const
 
const Vec3 & getBaseOrigin () const
 
const btTransform & getBaseTrans () const
 
void resetToBase (unsigned deactivated_ticks=0)
 
void setCapturedByKart (int kart_id)
 
void dropFlagAt (const btTransform &t)
 
bool isInBase () const
 
bool isActivated () const
 
bool canBeCaptured () const
 
void update (int ticks)
 
void updateFlagTrans (const btTransform &off_base_trans=btTransform())
 
void updateFlagGraphics (irr::scene::IAnimatedMeshSceneNode *flag_node)
 
void initFlagRenderInfo (irr::scene::IAnimatedMeshSceneNode *flag_node)
 
- Public Member Functions inherited from Rewinder
 Rewinder (const std::string &ui="")
 
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 ()
 

Static Public Attributes

static const int IN_BASE = -1
 
static const int OFF_BASE = -2
 

Private Attributes

int8_t m_flag_status
 
btTransform m_flag_trans
 
const btTransform m_flag_base_trans
 
uint16_t m_ticks_since_off_base
 
FlagColor m_flag_color
 
int m_off_base_compressed [4]
 
std::shared_ptr< GE::GERenderInfo > m_flag_render_info
 
uint16_t m_deactivated_ticks
 

Additional Inherited Members

- Protected Member Functions inherited from Rewinder
void setUniqueIdentity (const std::string &uid)
 

Member Function Documentation

◆ restoreState()

void CTFFlag::restoreState ( BareNetworkString *  buffer,
int  count 
)
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.

Implements Rewinder.

◆ rewindToEvent()

virtual void CTFFlag::rewindToEvent ( BareNetworkString *  buffer)
inlinevirtual

Called when an event needs to be replayed.

This is called during rewind, i.e. when going forward in time again.

Implements Rewinder.

◆ saveState()

BareNetworkString * CTFFlag::saveState ( std::vector< std::string > *  ru)
virtual

Provides a copy of the state of the object in one memory buffer.

The memory is managed by the RewindManager.

Parameters
[out]ruThe unique identity of rewinder writing to.
Returns
The address of the memory buffer with the state.

Implements Rewinder.

◆ saveTransform()

virtual void CTFFlag::saveTransform ( )
inlinevirtual

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.

Implements Rewinder.

◆ undoEvent()

virtual void CTFFlag::undoEvent ( BareNetworkString *  buffer)
inlinevirtual

Called when an event needs to be undone.

This is called while going backwards for rewinding - all stored events will get an 'undo' call.

Implements Rewinder.

◆ undoState()

virtual void CTFFlag::undoState ( BareNetworkString *  buffer)
inlinevirtual

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.

Implements Rewinder.


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