xoreos  0.0.5
objectcontainer.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_DRAGONAGE2_OBJECTCONTAINER_H
26 #define ENGINES_DRAGONAGE2_OBJECTCONTAINER_H
27 
28 #include <list>
29 #include <map>
30 
31 #include "src/common/types.h"
32 
34 
36 
37 namespace Aurora {
38  namespace NWScript {
39  class EngineType;
40  }
41 }
42 
43 namespace Engines {
44 
45 namespace DragonAge2 {
46 
47 class Object;
48 class Area;
49 class Waypoint;
50 class Placeable;
51 class Creature;
52 
53 class Event;
54 
57 public:
59 
61 
62 private:
63  float xt, yt, zt;
64 
66 };
67 
69 public:
72 
73  void clearObjects();
74 
76  void addObject(DragonAge2::Object &object);
78  void removeObject(DragonAge2::Object &object);
79 
82 
85 
87 
88  static Area *toArea (Aurora::NWScript::Object *object);
92 
93  static Event *toEvent(Aurora::NWScript::EngineType *engineType);
94 
95 private:
96  typedef std::list<DragonAge2::Object *> ObjectList;
97  typedef std::map<ObjectType, ObjectList> ObjectMap;
98 
100 };
101 
102 } // End of namespace DragonAge2
103 
104 } // End of namespace Engines
105 
106 #endif // ENGINES_DRAGONAGE2_OBJECTCONTAINER_H
::Aurora::NWScript::Object * getFirstObjectByType(ObjectType type) const
Return the first object of this type.
static Creature * toCreature(Aurora::NWScript::Object *object)
std::map< ObjectType, ObjectList > ObjectMap
A class able to sort objects by distance to a target object.
std::list< DragonAge2::Object * > ObjectList
An area in Dragon Age II, holding all objects and rooms within, as well as general area properties li...
Definition: area.h:64
void addObject(DragonAge2::Object &object)
Add an object to this container.
static Waypoint * toWaypoint(Aurora::NWScript::Object *object)
void removeObject(DragonAge2::Object &object)
Remove an object from this container.
float getDistance(DragonAge2::Object &a)
SDL_Event Event
Definition: types.h:42
::Aurora::NWScript::ObjectSearch * findObjectsByType(ObjectType type) const
Return a search context to iterate over all objects of this type.
static Event * toEvent(Aurora::NWScript::EngineType *engineType)
Low-level type definitions to handle fixed width types portably.
bool operator()(DragonAge2::Object *a, DragonAge2::Object *b)
static Area * toArea(Aurora::NWScript::Object *object)
ObjectType
Object type, matches the bitfield in script.ldf.
Definition: types.h:60
static DragonAge2::Object * toObject(::Aurora::NWScript::Object *object)
static Placeable * toPlaceable(Aurora::NWScript::Object *object)
ObjectDistanceSort(const DragonAge2::Object &target)
Basic Dragon Age II type definitions.
An NWScript object container.