Skip to content

Commit

Permalink
PINK: implemented SideEffectModuleVariable fully
Browse files Browse the repository at this point in the history
  • Loading branch information
whitertandrek authored and sev- committed Jun 28, 2018
1 parent d303144 commit 7c4bcc0
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 5 deletions.
4 changes: 4 additions & 0 deletions engines/pink/actors/actor.cpp
Expand Up @@ -47,4 +47,8 @@ Action *Actor::findAction(Common::String &name) {
});;
}

GamePage *Actor::getPage() const {
return _page;
}

} // End of namespace Pink
1 change: 1 addition & 0 deletions engines/pink/actors/actor.h
Expand Up @@ -40,6 +40,7 @@ class Actor : public NamedObject {
Action *findAction(Common::String &name);

Sequencer *getSequencer();
GamePage *getPage() const;

protected:
GamePage *_page;
Expand Down
3 changes: 2 additions & 1 deletion engines/pink/actors/lead_actor.h
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions engines/pink/module.cpp
Expand Up @@ -95,6 +95,10 @@ PinkEngine *Module::getGame() const {
return _game;
}

Common::StringMap &Module::getMap() {
return _map;
}

} // End of namespace Pink


Expand Down
7 changes: 4 additions & 3 deletions engines/pink/module.h
Expand Up @@ -52,12 +52,13 @@ class Module : public NamedObject {
void OnMouseMove();
void OnKeyboardButtonClick();

private:
PinkEngine *_game;
public:
Common::StringMap &getMap();

PinkEngine *getGame() const;


private:
PinkEngine *_game;
GamePage *_page;
PagesArray _pages;
InventoryMgr _invMgr;
Expand Down
4 changes: 4 additions & 0 deletions engines/pink/page.cpp
Expand Up @@ -108,4 +108,8 @@ Sequencer *GamePage::getSequencer() {
return _sequencer;
}

Module *GamePage::getModule() const {
return _module;
}

} // End of namespace Pink
3 changes: 3 additions & 0 deletions engines/pink/page.h
Expand Up @@ -67,10 +67,13 @@ class GamePage : public Page {

PinkEngine *getGame();
Sequencer *getSequencer();
Module *getModule() const;

private:
int perhapsIsLoaded;
Module *_module;

private:
CursorMgr *_cursorMgr;
WalkMgr *_walkMgr;
Sequencer *_sequencer;
Expand Down
2 changes: 1 addition & 1 deletion engines/pink/side_effects/side_effect.h
Expand Up @@ -32,7 +32,7 @@ class LeadActor;
class SideEffect : public Object {
public:
virtual ~SideEffect() {};
virtual void init(LeadActor *_actor) {};
virtual void init(LeadActor *actor) {};

};

Expand Down
7 changes: 7 additions & 0 deletions engines/pink/side_effects/side_effect_module_variable.cpp
Expand Up @@ -25,6 +25,8 @@
*/

#include "side_effect_module_variable.h"
#include "../actors/lead_actor.h"
#include "../page.h"

namespace Pink {

Expand All @@ -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;
}

}
1 change: 1 addition & 0 deletions engines/pink/side_effects/side_effect_module_variable.h
Expand Up @@ -30,6 +30,7 @@ class SideEffectModuleVariable : public SideEffectVariable {
public:
virtual void deserialize(Archive &archive);

virtual void init(LeadActor *actor);
};

} // End of namespace Pink
Expand Down

0 comments on commit 7c4bcc0

Please sign in to comment.