ScummVM API documentation
module.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 PINK_MODULE_H
23 #define PINK_MODULE_H
24 
25 #include "common/debug.h"
26 #include "common/hash-str.h"
27 
28 #include "pink/archive.h"
29 #include "pink/objects/object.h"
30 #include "pink/objects/inventory.h"
31 
32 namespace Pink {
33 
34 class ModuleProxy : public NamedObject {
35 public:
36  ModuleProxy();
37  ModuleProxy(const Common::String &name);
38 };
39 
40 class PinkEngine;
41 class GamePage;
42 
43 class Module : public NamedObject {
44 public:
45  Module(PinkEngine *game, const Common::String &name);
46  ~Module() override;
47 
48  void loadState(Archive &archive);
49  void saveState(Archive &archive);
50 
51  void load(Archive &archive) override;
52  void init(bool isLoadingSave, const Common::String &pageName);
53  void changePage(const Common::String &pageName);
54 
55  PinkEngine *getGame() const { return _game; }
56  InventoryMgr *getInventoryMgr() { return &_invMgr; }
57  const InventoryMgr *getInventoryMgr() const { return &_invMgr; }
58 
59  bool checkValueOfVariable(const Common::String &variable, const Common::String &value) const;
60  void setVariable(Common::String &variable, Common::String &value) { _variables[variable] = value; }
61 
62  GamePage *getPage() { return _page; }
63  const GamePage *getPage() const { return _page; }
64 
65  friend class Console;
66 
67 private:
68  GamePage *findPage(const Common::String &pageName) const;
69 
70  PinkEngine *_game;
71  GamePage *_page;
72  Array<GamePage *> _pages;
73  InventoryMgr _invMgr;
74  StringMap _variables;
75 };
76 
77 
78 } // End of namespace Pink
79 
80 #endif
Definition: archive.h:39
Definition: str.h:59
Definition: module.h:34
Definition: inventory.h:48
Definition: console.h:31
Definition: pink.h:95
Definition: object.h:40
Definition: module.h:43
Definition: archive.h:35
Definition: utils.h:52
Definition: utils.h:30
Definition: game_page.h:34