scummvm/engines/pink/objects/side_effect.h

112 lines
2.7 KiB
C
Raw Normal View History

/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef PINK_SIDE_EFFECT_H
#define PINK_SIDE_EFFECT_H
2018-05-21 21:38:02 +03:00
#include "pink/utils.h"
2018-05-21 12:30:27 +03:00
#include "pink/objects/object.h"
namespace Pink {
class Actor;
class SideEffect : public Object {
public:
2020-02-09 12:05:31 +01:00
void deserialize(Archive &archive) override = 0;
2018-05-22 08:03:37 +03:00
virtual void execute(Actor *actor) = 0;
};
class SideEffectExit : public SideEffect {
public:
2020-02-09 12:05:31 +01:00
void deserialize(Archive &archive) override;
2020-02-13 21:57:52 +01:00
void toConsole() const override;
2020-02-09 12:05:31 +01:00
void execute(Actor *actor) override;
private:
2018-05-22 08:03:37 +03:00
Common::String _nextModule;
Common::String _nextPage;
};
class SideEffectLocation : public SideEffect {
public:
2020-02-09 12:05:31 +01:00
void deserialize(Archive &archive) override;
void execute(Actor *actor) override;
2020-02-13 21:57:52 +01:00
void toConsole() const override;
private:
2018-05-22 08:03:37 +03:00
Common::String _location;
};
class SideEffectInventoryItemOwner : public SideEffect {
public:
2020-02-09 12:05:31 +01:00
void deserialize(Archive &archive) override;
void execute(Actor *actor) override;
2020-02-13 21:57:52 +01:00
void toConsole() const override;
private:
2018-05-22 08:03:37 +03:00
Common::String _item;
Common::String _owner;
};
class SideEffectVariable : public SideEffect {
public:
2020-02-09 12:05:31 +01:00
void deserialize(Archive &archive) override;
void execute(Actor *actor) override = 0;
protected:
2018-05-22 08:03:37 +03:00
Common::String _name;
Common::String _value;
};
class SideEffectGameVariable : public SideEffectVariable {
public:
2020-02-13 21:57:52 +01:00
void toConsole() const override;
2020-02-09 12:05:31 +01:00
void execute(Actor *actor) override;
};
class SideEffectModuleVariable : public SideEffectVariable {
public:
2020-02-13 21:57:52 +01:00
void toConsole() const override;
2020-02-09 12:05:31 +01:00
void execute(Actor *actor) override;
};
class SideEffectPageVariable : public SideEffectVariable {
public:
2020-02-13 21:57:52 +01:00
void toConsole() const override;
2020-02-09 12:05:31 +01:00
void execute(Actor *actor) override;
};
2018-05-22 11:58:02 +03:00
class SideEffectRandomPageVariable : public SideEffect {
public:
2020-02-09 12:05:31 +01:00
void deserialize(Archive &archive) override;
2020-02-13 21:57:52 +01:00
void toConsole() const override;
2020-02-09 12:05:31 +01:00
void execute(Actor *actor) override;
private:
2018-05-22 08:03:37 +03:00
Common::String _name;
StringArray _values;
};
2018-05-21 21:38:02 +03:00
} // End of namespace Pink
#endif