SuperTuxKart
Loading...
Searching...
No Matches
attachment_plugin.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2011-2015 Joerg Henrichs
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 3
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19#ifndef HEADER_ATTACHMENT_PLUGIN_HPP
20#define HEADER_ATTACHMENT_PLUGIN_HPP
21
22#include "vector3d.h"
23
24class AbstractKart;
25class Attachment;
27
39{
40protected:
43
44 Attachment* m_attachment;
45public:
48 {
49 m_kart = kart;
50 m_attachment = attachment;
51 }
52
53 virtual ~AttachmentPlugin() {}
54
55 virtual void updateGraphics(float dt) = 0;
56
57 // ------------------------------------------------------------------------
60 virtual bool updateAndTestFinished(int ticks) = 0;
61 // ------------------------------------------------------------------------
62 virtual void restoreState(BareNetworkString *buffer) {}
63 // ------------------------------------------------------------------------
64 virtual void saveState(BareNetworkString *buffer) const {}
65
66}; // AttachmentPlugin
67
68#endif
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
This is the base class for a plugin into an attachment.
Definition: attachment_plugin.hpp:39
virtual bool updateAndTestFinished(int ticks)=0
Updates a plugin.
AbstractKart * m_kart
Kart the attachment is attached to.
Definition: attachment_plugin.hpp:42
AttachmentPlugin(AbstractKart *kart, Attachment *attachment)
Constructor for a plugin.
Definition: attachment_plugin.hpp:47
This objects is permanently available in a kart and stores information about addons.
Definition: attachment.hpp:52
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53