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 QUEEN_STATE_H
24 #define QUEEN_STATE_H
25 
26 #include "common/util.h"
27 #include "queen/defs.h"
28 
29 namespace Queen {
30 
31 
32 enum StateTalk {
33 	STATE_TALK_TALK,
34 	STATE_TALK_MUTE
35 };
36 
37 enum StateGrab {
38 	STATE_GRAB_NONE,
39 	STATE_GRAB_DOWN,
40 	STATE_GRAB_UP,
41 	STATE_GRAB_MID
42 };
43 
44 enum StateOn {
45 	STATE_ON_ON,
46 	STATE_ON_OFF
47 };
48 
49 enum StateUse {
50 	STATE_USE,
51 	STATE_USE_ON
52 };
53 
54 
55 /*!
56 	Each object/item in game has a state field.
57 	(refer to ObjectData and ItemData).
58 
59 	<table>
60 		<tr>
61 			<td>Name</td>
62 			<td>Bits</td>
63 			<td>Description</td>
64 		</tr>
65 		<tr>
66 			<td>USE</td>
67 			<td>10</td>
68 			<td>Use</td>
69 		</tr>
70 		<tr>
71 			<td>TALK</td>
72 			<td>9</td>
73 			<td>Talk</td>
74 		</tr>
75 		<tr>
76 			<td>ON</td>
77 			<td>8</td>
78 			<td>On/Off</td>
79 		</tr>
80 		<tr>
81 			<td>DEF</td>
82 			<td>7,6,5,4</td>
83 			<td>Default verb command</td>
84 		</tr>
85 		<tr>
86 			<td>DIR</td>
87 			<td>3,2</td>
88 			<td>Direction to face for the object</td>
89 		</tr>
90 		<tr>
91 			<td>GRAB</td>
92 			<td>1,0</td>
93 			<td>Grab Direction</td>
94 		</tr>
95 	</table>
96 */
97 struct State {
98 
99 	static Direction findDirection(uint16 state);
100 	static StateTalk findTalk(uint16 state);
101 	static StateGrab findGrab(uint16 state);
102 	static StateOn   findOn(uint16 state);
103 	static Verb      findDefaultVerb(uint16 state);
104 	static StateUse  findUse(uint16 state);
105 
106 	static void alterOn(uint16 *objState, StateOn state);
107 	static void alterDefaultVerb(uint16 *objState, Verb v);
108 };
109 
110 
111 } // End of namespace Queen
112 
113 #endif
114