SuperTuxKart
|
This is the base class for a plugin into an attachment. More...
#include <attachment_plugin.hpp>
Public Member Functions | |
AttachmentPlugin (AbstractKart *kart, Attachment *attachment) | |
Constructor for a plugin. | |
virtual void | updateGraphics (float dt)=0 |
virtual bool | updateAndTestFinished (int ticks)=0 |
Updates a plugin. | |
virtual void | restoreState (BareNetworkString *buffer) |
virtual void | saveState (BareNetworkString *buffer) const |
Protected Attributes | |
AbstractKart * | m_kart |
Kart the attachment is attached to. | |
Attachment * | m_attachment |
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.
|
pure virtual |
Updates a plugin.
This is called once each time frame. If the function returns true, the attachment is discarded.
Implemented in Swatter.