#2 [Skills => DEV] (By IgorBat) Preliminary realisation of Spell & Effect classes

Merged
Endevir merged 1 commits from endevir/skills into GooseHouse/dev 6 years ago
2 changed files with 75 additions and 0 deletions
  1. 31 0
      effect.h
  2. 44 0
      spell.h

+ 31 - 0
effect.h

@@ -0,0 +1,31 @@
+//
+// Created by IgorBat on 17.03.2018.
+//
+
+#ifndef THE_GAME_EFFECT_H
+#define THE_GAME_EFFECT_H
+
+#pragma once
+#include <iostream>
+#include <vector>
+//#include "AbstractFactory.h"
+enum typeEffect{damage, strength};
+class Effect {
+
+private:
+    int count_;
+    typeEffect typeEffect_;
+public:
+    Effect() = delete;
+    Effect(std::string path) {
+
+    }
+    virtual ~Effect() = delete;
+
+    int getCount();
+    void setCount(int value);
+
+    typeEffect getType();
+    void setType(typeEffect value);
+};
+#endif //THE_GAME_EFFECT_H

+ 44 - 0
spell.h

@@ -0,0 +1,44 @@
+//
+// Created by IgorBat on 17.03.2018.
+//
+
+#ifndef THE_GAME_SPELL_H
+#define THE_GAME_SPELL_H
+
+#pragma once
+#include <iostream>
+#include <vector>
+//#include "AbstractFactory.h"
+#include "effect.h"
+class Cell;
+
+class Spell {
+
+protected:
+    std::vector <Effect> effects_;
+
+private:
+    int distance_;
+    bool forCell_;
+public:
+    Spell() = delete;
+    Spell(std::string path) {
+
+    }
+    virtual ~Spell() = delete;
+
+    int getDistance();
+    void setDistance(int value);
+
+    bool getForCell();
+    void setForCell(bool value);
+
+    int lenOfActualPath(Cell* destination);
+
+    virtual bool canCastForDistance(int distance);
+
+    virtual bool canCastToCell(Cell* destination);
+
+    virtual void castToCell(Cell* destination);
+};
+#endif //THE_GAME_SPELL_H