ScummVM API documentation
inventory.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef MADS_INVENTORY_H
23 #define MADS_INVENTORY_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/serializer.h"
28 #include "mads/core/resources.h"
29 
30 namespace MADS {
31 
32 enum {
33  PLAYER_INVENTORY = 2, NOWHERE = 1
34 };
35 
36 class RexNebularEngine;
37 
38 #define MAX_VOCAB 5
39 #define MAX_QUALITIES 4
40 
42 public:
43  int _descId;
44  int _roomNumber;
45  int _article;
46  int _vocabCount;
47  int _qualitiesCount;
48  int syntax;
49 
50  struct {
51  int _vocabId;
52  VerbType _verbType;
53  PrepType _prepType;
54  } _vocabList[MAX_VOCAB];
55 
56  int _qualityId[MAX_QUALITIES];
57  int _qualityValue[MAX_QUALITIES];
58 
63 
67  bool hasQuality(int qualityId) const;
68 
72  void setQuality(int qualityId, int qualityValue);
73 
77  int getQuality(int qualityId) const;
78 };
79 
80 class InventoryObjects : public Common::Array<InventoryObject> {
81 private:
82  RexNebularEngine *_vm;
83 
84 public:
85  SynchronizedList _inventoryList;
86 
91 
95  void load();
96 
101 
105  InventoryObject &getItem(int itemIndex) {
106  return (*this)[_inventoryList[itemIndex]];
107  }
108 
112  void setRoom(int objectId, int sceneNumber);
113 
117  bool isInRoom(int objectId) const;
118 
122  bool isInInventory(int objectId) const;
123 
127  void addToInventory(int objectId);
128 
134  void removeFromInventory(int objectId, int newScene);
135 
136  int getIdFromDesc(int objectId);
137 };
138 
139 } // namespace MADS
140 
141 #endif /* MADS_INVENTORY_H */
Definition: array.h:52
Definition: resources.h:78
InventoryObject & getItem(int itemIndex)
Definition: inventory.h:105
Definition: inventory.h:80
Definition: serializer.h:79
Definition: nebular.h:50
int getQuality(int qualityId) const
InventoryObjects(RexNebularEngine *vm)
Definition: inventory.h:90
bool hasQuality(int qualityId) const
Definition: inventory.h:41
Definition: action.h:28
void synchronize(Common::Serializer &s)
void setQuality(int qualityId, int qualityValue)