Orxonox  0.0.5 Codename: Arcturus
PickupRepresentation.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Damian 'Mozork' Frick
24  * Co-authors:
25  * ...
26  *
27 */
28 
35 #ifndef _PickupRepresentation_H__
36 #define _PickupRepresentation_H__
37 
38 #include "PickupPrereqs.h"
39 
40 #include "core/XMLPort.h"
41 
42 #include "interfaces/Pickupable.h"
44 
45 #include "PickupSpawner.h"
46 
47 #include "core/BaseObject.h"
49 
50 namespace orxonox // tolua_export
51 { // tolua_export
52 
91  class _PickupExport PickupRepresentation // tolua_export
92  : public BaseObject, public Synchronisable
93  { // tolua_export
94 
95  public:
97  PickupRepresentation(Context* context);
98  virtual ~PickupRepresentation();
99 
100  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
101 
106  inline const std::string& getPickupName(void) const { return this->name_; } // tolua_export
111  inline const std::string& getPickupDescription(void) const { return this->description_; } // tolua_export
116  inline const std::string& getSpawnerTemplate(void) const
117  { return this->spawnerTemplate_; }
123  inline const StaticEntity* getSpawnerRepresentationIndex(unsigned int index) const
124  { if(index == 0) return this->spawnerRepresentation_; return nullptr; }
129  inline const std::string& getInventoryRepresentation(void) const { return this->inventoryRepresentation_; } // tolua_export
130 
131  virtual void changedName() override;
132 
133  StaticEntity* createSpawnerRepresentation(PickupSpawner* spawner);
134 
135  protected:
140  inline void setPickupName(const std::string& name)
141  { this->name_ = name; }
146  inline void setPickupDescription(const std::string& description)
147  { this->description_ = description; }
153  inline void setSpawnerTemplate(const std::string& spawnerTemplate)
154  { this->spawnerTemplate_ = spawnerTemplate; }
160  void setSpawnerRepresentation(StaticEntity* representation);
161 
166  inline void setInventoryRepresentation(const std::string& image)
167  { this->inventoryRepresentation_ = image; }
168 
169  private:
170  void initialize(void);
171  StaticEntity* getDefaultSpawnerRepresentation(PickupSpawner* spawner);
172 
173  void registerVariables(void);
174 
180 
181  }; // tolua_export
182 
183 } // tolua_export
184 
185 #endif // _PickupRepresentation_H__
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
#define _PickupExport
Definition: PickupPrereqs.h:60
const std::string & getInventoryRepresentation(void) const
Get the name of the image representing the pickup in the PickupInventory.
Definition: PickupRepresentation.h:129
The StaticEntity is the simplest derivative of the orxonox::WorldEntity class.
Definition: StaticEntity.h:50
This class is the base class of all the Objects in the universe that need to be synchronised over the...
Definition: Synchronisable.h:142
Definition of the PickupSpawner class.
::std::string string
Definition: gtest-port.h:756
const std::string & getPickupName(void) const
Get the name of the Pickupable represented by this PickupRepresentation.
Definition: PickupRepresentation.h:106
Declaration of the XMLPort helper classes and macros.
void setInventoryRepresentation(const std::string &image)
Set the image representing the pickup in the PickupInventory.
Definition: PickupRepresentation.h:166
const std::string & getPickupDescription(void) const
Get the description of the Pickupable represented by this PickupRepresentation.
Definition: PickupRepresentation.h:111
StaticEntity * spawnerRepresentation_
The spawnerRepresentation of this PickupRepresentation.
Definition: PickupRepresentation.h:178
xmlelement
Definition: Super.h:519
void setPickupDescription(const std::string &description)
Set the description of the Pickupable represented by this PickupRepresentation.
Definition: PickupRepresentation.h:146
std::string spawnerTemplate_
The name of the template of this PickupRepresentation.
Definition: PickupRepresentation.h:177
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
const std::string & getSpawnerTemplate(void) const
Get the name of spawnerTemplate the Pickupable represented by this PickupRepresentation.
Definition: PickupRepresentation.h:116
std::string inventoryRepresentation_
The name of an image representing the pickup in the PickupInventory.
Definition: PickupRepresentation.h:179
Declaration of BaseObject, the base class of all objects in Orxonox.
Definition: Context.h:45
void setSpawnerTemplate(const std::string &spawnerTemplate)
Set the spawnerTemplate of the Pickupable represented by this PickupRepresentation.
Definition: PickupRepresentation.h:153
The PickupRepresentation class represents a specific pickup type.
Definition: PickupRepresentation.h:91
The PickupSpawner class is responsible for spawning @ref orxonox::Pickupable "Pickupables" of a speci...
Definition: PickupSpawner.h:76
void setPickupName(const std::string &name)
Set the name of the Pickupable represented by this PickupRepresentation.
Definition: PickupRepresentation.h:140
Shared library macros, enums, constants and forward declarations for the questsystem module ...
internal::String name_
Definition: gtest.cc:2289
std::string description_
The description of the Pickupable represented by this PickupRepresentation.
Definition: PickupRepresentation.h:176
const StaticEntity * getSpawnerRepresentationIndex(unsigned int index) const
Get the StaticEntity that defines how the PickupSpawner of the Pickupable represented by this PickupR...
Definition: PickupRepresentation.h:123
std::string name_
The name of the Pickupable represented by this PickupRepresentation.
Definition: PickupRepresentation.h:175
Definition of the Pickupable class.