Orxonox  0.0.5 Codename: Arcturus
PickupCollection.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 _PickupCollection_H__
36 #define _PickupCollection_H__
37 
38 #include "PickupPrereqs.h"
39 
40 #include <list>
41 
42 #include "CollectiblePickup.h"
43 #include "core/BaseObject.h"
44 
45 namespace orxonox
46 {
47 
69  {
70 
71  public:
72  PickupCollection(Context* context);
73  virtual ~PickupCollection();
74 
75  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
76 
77  virtual void changedUsed(void) override;
78  virtual void changedCarrier(void) override;
79  virtual void changedPickedUp(void) override;
80 
81  virtual bool isTarget(const PickupCarrier* carrier) const override;
82 
83  inline void setRepresentationName(const std::string& name)
84  { this->representationName_ = name; }
85  virtual const std::string& getRepresentationName() const override
86  { return this->representationName_; }
87 
88  bool addPickupable(CollectiblePickup* pickup);
89  const Pickupable* getPickupable(unsigned int index) const;
90  bool removePickupable(CollectiblePickup* pickup);
91 
92  inline const std::list<CollectiblePickup*>& getPickups() const
93  { return this->pickups_; }
94 
95  void pickupChangedUsed(bool changed);
96  void pickupChangedPickedUp(bool changed);
97  void pickupDisabled(void);
98 
99  protected:
100  virtual bool createSpawner(void) override;
101 
102  private:
103  void changedUsedAction(void);
104  void changedPickedUpAction(void);
105  void pickupsChanged(void);
106 
108  std::list<CollectiblePickup*> pickups_;
109 
112 
113  };
114 
115 }
116 
117 #endif /* _PickupCollection_H__ */
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
const std::list< CollectiblePickup * > & getPickups() const
Definition: PickupCollection.h:92
#define _PickupExport
Definition: PickupPrereqs.h:60
bool processingUsed_
Boolean to ensure, that the PickupCollection doesn&#39;t update its used status while its internal state ...
Definition: PickupCollection.h:110
An Interface (or more precisely an abstract class) to model and represent different (all kinds of) pi...
Definition: Pickupable.h:60
::std::string string
Definition: gtest-port.h:756
Definition of the CollectiblePickup class.
std::list< CollectiblePickup * > pickups_
The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
Definition: PickupCollection.h:108
xmlelement
Definition: Super.h:519
void setRepresentationName(const std::string &name)
Definition: PickupCollection.h:83
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
std::string representationName_
The name of the associated PickupRepresentation.
Definition: PickupCollection.h:107
bool processingPickedUp_
Boolean to ensure, that the PickupCollection doesn&#39;t update its picked upp status while its internal ...
Definition: PickupCollection.h:111
virtual const std::string & getRepresentationName() const override
Returns the representation name which refers to the name of the PickupRepresentation that is used to ...
Definition: PickupCollection.h:85
Declaration of BaseObject, the base class of all objects in Orxonox.
The PickupCollection combines different Pickupables (more precisely CollectiblePickups) to a coherent...
Definition: PickupCollection.h:68
Definition: Context.h:45
The CollectiblePickup class encompasses all Pickupables that can be added to a PickupCollection and t...
Definition: CollectiblePickup.h:55
The PickupCarrier interface provides the means, for any class implementing it, to possess Pickupables...
Definition: PickupCarrier.h:68
Shared library macros, enums, constants and forward declarations for the questsystem module ...