SuperTuxKart
Public Member Functions | Protected Attributes | List of all members
AttachmentPlugin Class Referenceabstract

This is the base class for a plugin into an attachment. More...

#include <attachment_plugin.hpp>

Inheritance diagram for AttachmentPlugin:
Inheritance graph
[legend]

Public Member Functions

 AttachmentPlugin (AbstractKart *kart, Attachment *attachment)
 Constructor for a plugin. More...
 
virtual void updateGraphics (float dt)=0
 
virtual bool updateAndTestFinished (int ticks)=0
 Updates a plugin. More...
 
virtual void restoreState (BareNetworkString *buffer)
 
virtual void saveState (BareNetworkString *buffer) const
 

Protected Attributes

AbstractKartm_kart
 Kart the attachment is attached to. More...
 
Attachmentm_attachment
 

Detailed Description

This is the base class for a plugin into an attachment.

Plugins are used to handle attachment specific data so that the attachment class that is used in every kart isn't overloaded. It could be done by inheriting from Attachment, but then every time an attachment is changed, we could delete and create a new SceneNode. To avoid this overhead, we use plugins to encapsulate additional code for some plugins.

Constructor & Destructor Documentation

◆ AttachmentPlugin()

AttachmentPlugin::AttachmentPlugin ( AbstractKart kart,
Attachment attachment 
)
inline

Constructor for a plugin.

Member Function Documentation

◆ updateAndTestFinished()

virtual bool AttachmentPlugin::updateAndTestFinished ( int  ticks)
pure virtual

Updates a plugin.

This is called once each time frame. If the function returns true, the attachment is discarded.

Implemented in Swatter.

Member Data Documentation

◆ m_kart

AbstractKart* AttachmentPlugin::m_kart
protected

Kart the attachment is attached to.


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