1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program 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 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program 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 this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef NUVIE_MISC_MAP_ENTITY_H
24 #define NUVIE_MISC_MAP_ENTITY_H
25 
26 #include "ultima/nuvie/core/nuvie_defs.h"
27 
28 namespace Ultima {
29 namespace Nuvie {
30 
31 class Actor;
32 class MapCoord;
33 class NuvieAnim;
34 class Obj;
35 
36 typedef enum {
37 	ENT_NOTHING = 0,
38 	ENT_ACTOR,
39 	ENT_OBJ,
40 	ENT_ANIM
41 } EntityType;
42 
43 /* Any object on the map ("in the world") that isn't part of the map.
44  * WARNING: It just points to another object, and doesn't copy it.
45  */
46 typedef struct MapEntity_s {
47 	EntityType entity_type;
48 	union {
49 		char *data;
50 		Actor *actor;
51 		Obj *obj;
52 		NuvieAnim *anim;
53 	};
MapEntity_sMapEntity_s54 	MapEntity_s()             {
55 		entity_type = ENT_NOTHING;
56 		data = NULL;
57 	}
MapEntity_sMapEntity_s58 	MapEntity_s(Actor *a)     {
59 		entity_type = ENT_ACTOR;
60 		actor = a;
61 	}
MapEntity_sMapEntity_s62 	MapEntity_s(Obj *o)       {
63 		entity_type = ENT_OBJ;
64 		obj = o;
65 	}
MapEntity_sMapEntity_s66 	MapEntity_s(NuvieAnim *a) {
67 		entity_type = ENT_ANIM;
68 		anim = a;
69 	}
70 } MapEntity;
71 
72 } // End of namespace Nuvie
73 } // End of namespace Ultima
74 
75 #endif
76