SuperTuxKart
Loading...
Searching...
No Matches
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.
 
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

AbstractKartm_kart
 Kart the attachment is attached to.
 
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.

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.


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