Orxonox  0.0.5 Codename: Arcturus
Radar.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  * Reto Grieder
24  * Co-authors:
25  * Felix Schulthess
26  *
27  */
28 
34 #ifndef _Radar_H__
35 #define _Radar_H__
36 
37 #include "OrxonoxPrereqs.h"
38 
39 #include <map>
40 #include <set>
41 #include <string>
42 
46 
47 namespace orxonox
48 {
49  class _OrxonoxExport Radar : public Tickable
50  {
51  friend class RadarViewable;
52  public:
53  Radar();
54  virtual ~Radar();
55 
56  virtual void tick(float dt) override;
57 
58  const RadarViewable* getFocus();
59  RadarViewable::Shape addObjectDescription(const std::string& name);
60 
61  void listObjects() const;
62  const std::set<RadarViewable*>& getRadarObjects() const
63  { return this->radarObjects_; }
64 
65  void releaseFocus();
66  void cycleFocus();
67 
68  private:
69  Radar(Radar& instance);
70 
71  void updateFocus();
72  void addRadarObject(RadarViewable* rv);
73  void removeRadarObject(RadarViewable* rv);
74  void radarObjectChanged(RadarViewable* rv);
75 
78  std::map<std::string, RadarViewable::Shape> objectTypes_;
79  std::set<RadarViewable*> radarObjects_;
81  };
82 }
83 #endif /* _Radar_H__ */
Declaration of the Tickable interface.
ObjectList< RadarViewable >::iterator itFocus_
Definition: Radar.h:76
::std::string string
Definition: gtest-port.h:756
std::set< RadarViewable * > radarObjects_
Definition: Radar.h:79
int objectTypeCounter_
Definition: Radar.h:80
Interface for receiving window events.
Definition: RadarViewable.h:48
Definition: Radar.h:49
Shape
Definition: RadarViewable.h:51
std::map< std::string, RadarViewable::Shape > objectTypes_
Definition: Radar.h:78
Definition of the ObjectListIterator class, used to iterate through object-lists. ...
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Shared library macros, enums, constants and forward declarations for the orxonox library ...
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
const std::set< RadarViewable * > & getRadarObjects() const
Definition: Radar.h:62
RadarViewable * focus_
Definition: Radar.h:77
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
ObjectListIterator<T> allows to iterate through the ObjectList of class T.
Definition: CorePrereqs.h:210