PINK: implemented SideEffectModuleVariable fully

This commit is contained in:
whitertandrek 2018-03-19 14:12:36 +02:00 committed by Eugene Sandulenko
parent d303144364
commit 7c4bcc033d
10 changed files with 31 additions and 5 deletions

View File

@ -47,4 +47,8 @@ Action *Actor::findAction(Common::String &name) {
});;
}
GamePage *Actor::getPage() const {
return _page;
}
} // End of namespace Pink

View File

@ -40,6 +40,7 @@ public:
Action *findAction(Common::String &name);
Sequencer *getSequencer();
GamePage *getPage() const;
protected:
GamePage *_page;

View File

@ -34,7 +34,8 @@ class Sequencer;
class LeadActor : public Actor {
public:
virtual void deserialize(Archive &archive);
void setNextExecutors(Common::String &nextModule, Common::String &nextPage);
void setNextExecutors (Common::String &nextModule, Common::String &nextPage);
private:
CursorMgr *_cursorMgr;
WalkMgr *_walkMgr;

View File

@ -95,6 +95,10 @@ PinkEngine *Module::getGame() const {
return _game;
}
Common::StringMap &Module::getMap() {
return _map;
}
} // End of namespace Pink

View File

@ -52,12 +52,13 @@ public:
void OnMouseMove();
void OnKeyboardButtonClick();
private:
PinkEngine *_game;
public:
Common::StringMap &getMap();
PinkEngine *getGame() const;
private:
PinkEngine *_game;
GamePage *_page;
PagesArray _pages;
InventoryMgr _invMgr;

View File

@ -108,4 +108,8 @@ Sequencer *GamePage::getSequencer() {
return _sequencer;
}
Module *GamePage::getModule() const {
return _module;
}
} // End of namespace Pink

View File

@ -67,10 +67,13 @@ public:
PinkEngine *getGame();
Sequencer *getSequencer();
Module *getModule() const;
private:
int perhapsIsLoaded;
Module *_module;
private:
CursorMgr *_cursorMgr;
WalkMgr *_walkMgr;
Sequencer *_sequencer;

View File

@ -32,7 +32,7 @@ class LeadActor;
class SideEffect : public Object {
public:
virtual ~SideEffect() {};
virtual void init(LeadActor *_actor) {};
virtual void init(LeadActor *actor) {};
};

View File

@ -25,6 +25,8 @@
*/
#include "side_effect_module_variable.h"
#include "../actors/lead_actor.h"
#include "../page.h"
namespace Pink {
@ -34,4 +36,9 @@ void SideEffectModuleVariable::deserialize(Archive &archive) {
_name.c_str(), _value.c_str());
}
void SideEffectModuleVariable::init(LeadActor *actor) {
Common::StringMap &moduleMap = actor->getPage()->getModule()->getMap();
moduleMap[_name] = _value;
}
}

View File

@ -30,6 +30,7 @@ class SideEffectModuleVariable : public SideEffectVariable {
public:
virtual void deserialize(Archive &archive);
virtual void init(LeadActor *actor);
};
} // End of namespace Pink