diff options
Diffstat (limited to 'engines/pink/objects/module.cpp')
-rw-r--r-- | engines/pink/objects/module.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/engines/pink/objects/module.cpp b/engines/pink/objects/module.cpp index 019f71ba30..5a7dd6bbc9 100644 --- a/engines/pink/objects/module.cpp +++ b/engines/pink/objects/module.cpp @@ -27,52 +27,52 @@ namespace Pink { ModuleProxy::ModuleProxy(const Common::String &name) - : NamedObject(name) + : NamedObject(name) {} ModuleProxy::ModuleProxy() {} Module::Module(PinkEngine *game, const Common::String &name) - : NamedObject(name), _game(game), _page(nullptr) + : NamedObject(name), _game(game), _page(nullptr) {} Module::~Module() { - for (uint i = 0; i < _pages.size(); ++i) { - delete _pages[i]; - } + for (uint i = 0; i < _pages.size(); ++i) { + delete _pages[i]; + } } void Module::load(Archive &archive){ - archive.mapObject(this); - NamedObject::deserialize(archive); + archive.mapObject(this); + NamedObject::deserialize(archive); - archive.readString(); // skip directory + archive.readString(); // skip directory - _invMgr.deserialize(archive); - _pages.deserialize(archive); + _invMgr.deserialize(archive); + _pages.deserialize(archive); } void Module::init(bool isLoadingSave, const Common::String &pageName) { - // 0 0 - new game - // 0 1 - module changed - // 1 0 - from save - if (!pageName.empty()) - _page = findPage(pageName); - else if (!_page) - _page = _pages[0]; - - _page->init(isLoadingSave); + // 0 0 - new game + // 0 1 - module changed + // 1 0 - from save + if (!pageName.empty()) + _page = findPage(pageName); + else if (!_page) + _page = _pages[0]; + + _page->init(isLoadingSave); } void Module::changePage(const Common::String &pageName) { - GamePage *page = nullptr; - page = findPage(pageName); - assert(_page != page); + GamePage *page = nullptr; + page = findPage(pageName); + assert(_page != page); - _page->unload(); + _page->unload(); - _page = page; - _page->init(kLoadingNewGame); + _page = page; + _page->init(kLoadingNewGame); } GamePage *Module::findPage(const Common::String &pageName) const { @@ -84,21 +84,21 @@ GamePage *Module::findPage(const Common::String &pageName) const { } PinkEngine *Module::getGame() const { - return _game; + return _game; } bool Module::checkValueOfVariable(Common::String &variable, Common::String &value) { - if (!_variables.contains(variable)) - return value == kUndefined; - return _variables[variable] == value; + if (!_variables.contains(variable)) + return value == kUndefined; + return _variables[variable] == value; } void Module::setVariable(Common::String &variable, Common::String &value) { - _variables[variable] = value; + _variables[variable] = value; } InventoryMgr *Module::getInventoryMgr() { - return &_invMgr; + return &_invMgr; } } // End of namespace Pink |