SuperTuxKart
attachment_manager.hpp
1 //
2 // SuperTuxKart - a fun racing game with go-kart
3 // Copyright (C) 2006-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_MANAGER_HPP
20 #define HEADER_ATTACHMENT_MANAGER_HPP
21 
22 namespace irr
23 {
24  namespace scene { class IAnimatedMesh; }
25 }
26 class Material;
27 
28 #include "items/attachment.hpp"
29 #include "utils/no_copy.hpp"
30 
35 {
36 private:
37  scene::IAnimatedMesh *m_attachments[Attachment::ATTACH_MAX];
38  Material *m_all_icons [Attachment::ATTACH_MAX];
39 public:
40  AttachmentManager() {};
42  void loadModels ();
43  // ------------------------------------------------------------------------
46  scene::IAnimatedMesh *getMesh(Attachment::AttachmentType type) const
47  {return m_attachments[type]; }
48  // ------------------------------------------------------------------------
51  Material* getIcon (int type) const { return m_all_icons [type]; }
52  // ------------------------------------------------------------------------
53 };
54 
55 extern AttachmentManager *attachment_manager;
56 #endif
Definition: attachment_manager.hpp:34
Material * getIcon(int type) const
Returns the icon to display in the race gui if a kart has an attachment.
Definition: attachment_manager.hpp:51
scene::IAnimatedMesh * getMesh(Attachment::AttachmentType type) const
Returns the mest for a certain attachment.
Definition: attachment_manager.hpp:46
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:25
Definition: material.hpp:46