1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- //
- // Created by IgorBat on 17.03.2018.
- //
- #ifndef THE_GAME_EFFECT_H
- #define THE_GAME_EFFECT_H
- #pragma once
- #include <iostream>
- #include <vector>
- #include <QFile>
- #include <QString>
- #include <QTextStream>
- #include <QImage>
- class Unit;
- class Cell;
- class Effect : public QObject {
- Q_OBJECT
- public:
- enum TypeOfTrigger{
- InCome = 1,
- AfterAction = 2,
- AfterEndTurn = 3
- };
- Effect() = default;
- explicit Effect(QString parameters);
- virtual ~Effect() {}
- int getCount();
- void setCount(int value);
- int getDurability();
- void setDurability(int value);
- //---------------------------------------------//
- //----------------GUI section------------------//
- //---------------------------------------------//
- QString getEffectName() const;
- QString getEffectDescr() const;
- QImage getEffectIcon() const;
- //---------------------------------------------//
- //-----------Parameters load section-----------//
- //---------------------------------------------//
- private:
- void loadEffectDescr(QString effect_folder);
- void loadEffectIcon(QString effect_folder);
- public:
- virtual void OperateOnCell(Cell* cell) = 0;
- virtual void OperateOnUnit(Unit* unit) = 0;
- virtual void OperateOnUnitToCell(Unit* who, Cell* where) = 0;
- virtual void Execute(Cell* from, Cell* where, Unit* who, Unit* whom, TypeOfTrigger Type) = 0;
- protected:
- int count_;
- int durability_;
- // GUI values
- QString effect_name_;
- QString effect_descr_;
- QImage effect_icon_;
- };
- #endif //THE_GAME_EFFECT_H
|