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_JADE_OBJECTCONTAINER_H
26 #define ENGINES_JADE_OBJECTCONTAINER_H
27 
28 #include <list>
29 
30 #include "src/common/types.h"
31 
33 
34 #include "src/engines/jade/types.h"
35 
36 namespace Engines {
37 
38 namespace Jade {
39 
40 class Object;
41 class Module;
42 class Area;
43 class Waypoint;
44 class Placeable;
45 class Creature;
46 class Location;
47 class Event;
48 
51 public:
52  ObjectDistanceSort(const Jade::Object &target);
53 
55 
56 private:
57  float xt, yt, zt;
58 
59  float getDistance(Jade::Object &a);
60 };
61 
63 public:
66 
67  void clearObjects();
68 
70  void addObject(Jade::Object &object);
72  void removeObject(Jade::Object &object);
73 
76 
79 
81 
82  static Area *toArea (Aurora::NWScript::Object *object);
86  static Creature *toPC (Aurora::NWScript::Object *object);
87 
89  static Event *toEvent (Aurora::NWScript::EngineType *engineType);
90 
91 private:
92  typedef std::list<Jade::Object *> ObjectList;
93 
95 };
96 
97 } // End of namespace Jade
98 
99 } // End of namespace Engines
100 
101 #endif // ENGINES_JADE_OBJECTCONTAINER_H
::Aurora::NWScript::ObjectSearch * findObjectsByType(ObjectType type) const
Return a search context to iterate over all objects of this type.
void addObject(Jade::Object &object)
Add an object to this container.
static Creature * toCreature(Aurora::NWScript::Object *object)
void removeObject(Jade::Object &object)
Remove an object from this container.
static Placeable * toPlaceable(Aurora::NWScript::Object *object)
static Waypoint * toWaypoint(Aurora::NWScript::Object *object)
static Creature * toPC(Aurora::NWScript::Object *object)
static Event * toEvent(Aurora::NWScript::EngineType *engineType)
SDL_Event Event
Definition: types.h:42
A class able to sort objects by distance to a target object.
bool operator()(Jade::Object *a, Jade::Object *b)
static Jade::Object * toObject(::Aurora::NWScript::Object *object)
Basic Jade Empire type definitions.
An area in Jade Empire, holding all objects and rooms within, as well as general area properties like...
Definition: area.h:57
Low-level type definitions to handle fixed width types portably.
std::list< Jade::Object * > ObjectList
An object within a Jade area.
Definition: object.h:53
::Aurora::NWScript::Object * getFirstObjectByType(ObjectType type) const
Return the first object of this type.
ObjectList _objects[kObjectTypeMAX]
static Area * toArea(Aurora::NWScript::Object *object)
static Location * toLocation(Aurora::NWScript::EngineType *engineType)
float getDistance(Jade::Object &a)
ObjectDistanceSort(const Jade::Object &target)
An NWScript object container.