ScummVM API documentation
adv_inv.h
1 
2 /* ScummVM - Graphic Adventure Engine
3  *
4  * ScummVM is the legal property of its developers, whose names
5  * are too numerous to list here. Please refer to the COPYRIGHT
6  * file distributed with this source distribution.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef M4_ADV_R_ADV_INV_H
24 #define M4_ADV_R_ADV_INV_H
25 
26 #include "common/array.h"
27 #include "common/serializer.h"
28 #include "common/stream.h"
29 
30 namespace M4 {
31 
32 struct InvObj {
33  char *name = nullptr;
34  char *verbs = nullptr;
35  int32 scene = 0, cel = 0, cursor = 0;
36 };
37 
38 struct InventoryBase {
39  Common::Array<InvObj *> _objects;
40  int32 _tail = 0;
41 
42  InventoryBase() {}
43  virtual ~InventoryBase();
44 
45  void syncGame(Common::Serializer &s);
46 
47  virtual void add(const Common::String &name, const Common::String &verb, int32 sprite, int32 cursor) = 0;
48  virtual void set_scroll(int32 scroll) = 0;
49  virtual void remove(const Common::String &name) = 0;
50 };
51 
55 bool inv_init(int32 num_objects);
56 
66 bool inv_register_thing(const Common::String &itemName, const Common::String &itemVerbs, int32 scene, int32 cel, int32 cursor);
67 
68 int32 inv_where_is(const Common::String &itemName);
69 bool inv_player_has(const Common::String &itemName);
70 bool inv_put_thing_in(const Common::String &itemName, int32 scene);
71 int32 inv_get_cursor(const Common::String &itemName);
72 int32 inv_get_cel(const Common::String &itemName);
73 const char *inv_get_verbs(const Common::String &itemName);
74 void inv_give_to_player(const Common::String &itemName);
75 void inv_move_object(const Common::String &itemName, int32 scene);
76 bool inv_object_is_here(const Common::String &itemName);
77 bool inv_object_in_scene(const Common::String &itemName, int32 scene);
78 
79 void inv_sync_game(Common::Serializer &s);
80 
81 } // End of namespace M4
82 
83 #endif
bool inv_init(int32 num_objects)
Definition: str.h:59
bool inv_register_thing(const Common::String &itemName, const Common::String &itemVerbs, int32 scene, int32 cel, int32 cursor)
Definition: array.h:52
Definition: serializer.h:79
Definition: database.h:28
Definition: adv_inv.h:32
Definition: adv_inv.h:38