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/nebular/core/resources.h"
29 
30 namespace MADS {
31 namespace Nebular {
32 
33 enum {
34  PLAYER_INVENTORY = 2, NOWHERE = 1
35 };
36 
37 class RexNebularEngine;
38 
39 #define MAX_VOCAB 5
40 #define MAX_QUALITIES 4
41 
43 public:
44  int _descId;
45  int _roomNumber;
46  int _article;
47  int _vocabCount;
48  int _qualitiesCount;
49  int syntax;
50 
51  struct {
52  int _vocabId;
53  VerbType _verbType;
54  PrepType _prepType;
55  } _vocabList[MAX_VOCAB];
56 
57  int _qualityId[MAX_QUALITIES];
58  int _qualityValue[MAX_QUALITIES];
59 
64 
68  bool hasQuality(int qualityId) const;
69 
73  void setQuality(int qualityId, int qualityValue);
74 
78  int getQuality(int qualityId) const;
79 };
80 
81 class InventoryObjects : public Common::Array<InventoryObject> {
82 private:
83  RexNebularEngine *_vm;
84 
85 public:
86  SynchronizedList _inventoryList;
87 
92  }
93 
97  void load();
98 
103 
107  InventoryObject &getItem(int itemIndex) {
108  return (*this)[_inventoryList[itemIndex]];
109  }
110 
114  void setRoom(int objectId, int sceneNumber);
115 
119  bool isInRoom(int objectId) const;
120 
124  bool isInInventory(int objectId) const;
125 
129  void addToInventory(int objectId);
130 
136  void removeFromInventory(int objectId, int newScene);
137 
138  int getIdFromDesc(int objectId);
139 };
140 
141 } // namespace Nebular
142 } // namespace MADS
143 
144 #endif
Definition: inventory.h:42
Definition: nebular.h:51
Definition: array.h:52
void setQuality(int qualityId, int qualityValue)
bool hasQuality(int qualityId) const
Definition: serializer.h:80
InventoryObject & getItem(int itemIndex)
Definition: inventory.h:107
Definition: inventory.h:81
int getQuality(int qualityId) const
Definition: sound_manager.h:38
Definition: resources.h:82
void synchronize(Common::Serializer &s)
InventoryObjects(RexNebularEngine *vm)
Definition: inventory.h:91