Group_B_VirtualEscapeRoom
object.h
Go to the documentation of this file.
1 
6 #ifndef __OBJECT_H__
7 #define __OBJECT_H__
8 
14 typedef enum type{
15  location = 0,
19  puzzle = 4,
20  hint = 5,
21  actor = 6
23 
29 typedef enum state{
30  closed = 0, open = 1, // For doors and locks
31  confined = 2, unrestricted = 3, // For stages
32  unsolved = 4, solved = 5, // For puzzles
33  hidden = 6, revealed = 7, // For keys
34  used = 8, unused =9, // For hints
35  regular = 10 // generic state
37 
43 typedef struct object{
48  const char *description;
49 
54  const char *tag;
55 
61 
67 
72  const char *detailed_description;
73 
78  struct object *location;
80 extern OBJECT_t objs[];
81 
82 
83 /***** Object References using symbolic names *****/
84 /* Stages */
85 #define stage1 (objs + 0)
86 #define stage2 (objs + 1)
87 #define stage3 (objs + 2)
88 /* Actors */
89 #define player (objs + 3)
90 /* Objects Visible in Stage 1 */
91 
92 #define table (objs + 4)
93 #define letter (objs + 5)
94 #define clock (objs + 6)
95 #define jigsaw_puzzle (objs + 7)
96 #define treasure_bag (objs + 8)
97 /* Objects Visible in Stage 2 */
98 #define sheet_music (objs + 9)
99 #define old_piano (objs + 10)
100 #define pirate_chest (objs + 11)
101 /* Doors and Keys */
102 #define silver_key (objs + 12)
103 #define silver_door (objs + 13)
104 #define gold_key (objs + 14)
105 #define gold_door (objs + 15)
106 #define ruby_key (objs + 16)
107 #define ruby_door (objs + 17)
108 /* Puzzles */
109 #define clock_puzzle (objs + 18)
110 #define sliding_puzzle (objs + 19)
111 #define paper_puzzle (objs + 20)
112 #define piano_puzzle (objs + 21)
113 #define riddle_puzzle (objs + 22)
114 /* Hints */
115 
116 #define clock_hint (objs + 23)
117 #define paper_hint (objs + 24)
118 #define slider_hint (objs + 25)
119 #define graffiti (objs + 26)
120 #define graffiti_puzzle (objs + 27)
121 #define graffiti_hint (objs + 28)
122 #define piano_hint (objs + 29)
123 #define riddle_hint (objs + 30)
124 /* Lock with code */
125 #define blue_lock (objs + 31)
126 #define manual (objs + 32)
127 #define code_puzzle (objs + 33)
128 #define code_hint (objs + 34)
129 #define cupboard (objs + 35)
130 #define cupboard_puzzle (objs + 36)
131 #define cupboard_hint (objs + 37)
132 
133 #define phone (objs + 38)
134 #define phone_puzzle (objs + 39)
135 #define phone_hint (objs + 40)
136 
137 
138 /* End: always update this! */
139 #define end_of_objs (objs + 41)
140 
141 
142 #endif//__OBJECT_H__
object::description
const char * description
Short text description of object Description of object in the current stage of game.
Definition: object.h:48
object
Main game object.
Definition: object.h:43
actor
@ actor
Definition: object.h:21
unused
@ unused
Definition: object.h:34
open
@ open
Definition: object.h:30
used
@ used
Definition: object.h:34
object::location
struct object * location
Location of object Location of object as another object.
Definition: object.h:78
objs
OBJECT_t objs[]
Definition: object.c:5
regular
@ regular
Definition: object.h:35
hidden_object
@ hidden_object
Definition: object.h:17
hint
@ hint
Definition: object.h:20
state_t
enum state state_t
Game object state.
unrestricted
@ unrestricted
Definition: object.h:31
visible_object
@ visible_object
Definition: object.h:16
hidden
@ hidden
Definition: object.h:33
object::type
type_t type
Type of object Used to determine the type of an object, such as location, usable_objects,...
Definition: object.h:60
puzzle
@ puzzle
Definition: object.h:19
location
@ location
Definition: object.h:15
revealed
@ revealed
Definition: object.h:33
solved
@ solved
Definition: object.h:32
type_t
enum type type_t
Game object type.
type
type
Game object type.
Definition: object.h:14
usable_object
@ usable_object
Definition: object.h:18
state
state
Game object state.
Definition: object.h:29
confined
@ confined
Definition: object.h:31
object::state
state_t state
State of object Used to keep track of state, such as whether a door is open, a puzzle is compelte,...
Definition: object.h:66
OBJECT_t
struct object OBJECT_t
Main game object.
object::detailed_description
const char * detailed_description
Long text description of object Used to describe the object in more detail, when inspecting an object...
Definition: object.h:72
object::tag
const char * tag
Tag for object Used to look up objects in the global list of objects.
Definition: object.h:54
unsolved
@ unsolved
Definition: object.h:32
closed
@ closed
Definition: object.h:30