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 ASYLUM_RESOURCES_INVENTORY_H
23 #define ASYLUM_RESOURCES_INVENTORY_H
24 
25 #include "common/serializer.h"
26 #include "common/stream.h"
27 
28 #include "asylum/asylum.h"
29 
30 namespace Asylum {
31 
33 public:
34  Inventory(AsylumEngine *vm, int32 &multiple);
35 
36  uint find(uint item = 0) const;
37  void add(uint item, uint multipleIncr);
38  void remove(uint item, uint multipleDecr);
39  bool contains(uint item, uint multiple) const;
40  void copyFrom(Inventory &inventory);
41 
42  uint getSelectedItem() const { return _selectedItem; }
43  void selectItem(uint item) { _selectedItem = item; }
44 
45  void load(Common::SeekableReadStream *stream);
46  void saveLoadWithSerializer(Common::Serializer &s);
47 
48  uint32 &operator[](uint index) { return _items[index]; }
49 
50  static Common::Point getInventoryRingPoint(AsylumEngine *vm, uint nPoints, uint index);
51  static void describe(AsylumEngine *vm, uint item);
52 
53 private:
54  uint32 _items[8];
55  uint32 _selectedItem;
56  int32 &_multiple;
57  AsylumEngine *_vm;
58 };
59 
60 } // End of namespace Asylum
61 
62 #endif // ASYLUM_RESOURCES_INVENTORY_H
Definition: inventory.h:32
Definition: asylum.h:53
Definition: stream.h:745
Definition: serializer.h:79
Definition: rect.h:45
Definition: asylum.h:73
Definition: serializer.h:308