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 /*
23  * This code is based on the CRAB engine
24  *
25  * Copyright (c) Arvind Raja Yadav
26  *
27  * Licensed under MIT
28  *
29  */
30 
31 #ifndef CRAB_INVENTORY_H
32 #define CRAB_INVENTORY_H
33 
34 #include "crab/item/ItemCollection.h"
35 #include "crab/item/ItemSlot.h"
36 #include "crab/ui/button.h"
37 #include "crab/ui/ImageData.h"
38 
39 namespace Crab {
40 
41 namespace pyrodactyl {
42 namespace ui {
43 class Inventory {
44  // The background image and location
45  ImageData _bg;
46 
47  // The equipment and storage space, stored according to the player character id
49 
50  // To draw the player stats
51  // pyrodactyl::stat::StatDrawHelper helper;
52 
53  // The file where all the item information is stored
54  Common::Path _itemfile;
55 
56  // Used to draw the money value
57  Button _money;
58 
59 public:
60  Inventory() {}
61  ~Inventory() {}
62 
63  void init(const Common::String &charId) {
64  _collection.init(charId);
65  }
66 
67  void loadItem(const Common::String &charId, const Common::String &name);
68  void addItem(const Common::String &charId, pyrodactyl::item::Item &item);
69  void delItem(const Common::String &charId, const Common::String &itemId);
70  bool hasItem(const Common::String &charId, const Common::String &container, const Common::String &itemId);
71 
72  void load(const Common::Path &filename);
73  void draw(pyrodactyl::people::Person &obj, const int &moneyVal);
74 
75  void handleEvents(const Common::String &string, const Common::Event &Event);
76 
77  void loadState(rapidxml::xml_node<char> *node);
78  void saveState(rapidxml::xml_document<> &doc, rapidxml::xml_node<char> *root);
79 
80  void itemFile(const Common::String &filename) {
81  _itemfile = filename;
82  }
83 
84  void setUI();
85 };
86 } // End of namespace ui
87 } // End of namespace pyrodactyl
88 
89 } // End of namespace Crab
90 
91 #endif // CRAB_INVENTORY_H
Definition: str.h:59
Definition: ItemCollection.h:42
Definition: Item.h:42
Definition: ImageData.h:40
Definition: path.h:52
Definition: person.h:43
Definition: events.h:199
Definition: moveeffect.h:37
Definition: button.h:86
Definition: Inventory.h:43