CardGame
Rogue-like card videogame
Loading...
Searching...
No Matches
effectFactory.h
Go to the documentation of this file.
1#ifndef EFFECTFACTORY_H
2#define EFFECTFACTORY_H
3
4#include "effects/effect.h"
5
6#include <any>
7#include <memory>
8#include <nlohmann/json.hpp>
9#include <unordered_map>
10#include <vector>
11
12enum class Target;
13
15{
16 public:
18
19 std::vector<std::unique_ptr<Effect>> makeEffectList(const nlohmann::json& effectList);
20
21 private:
22 std::unordered_map<std::string, std::unique_ptr<Effect> (*)(const nlohmann::json& effect)>
23 m_effectMap;
24
25 static Target identifyTarget(const std::string& targetSpecifier);
26
27 static std::unique_ptr<Effect> makeGainArmorEffect(const nlohmann::json& effect);
28 static std::unique_ptr<Effect> makeGainAttackEffect(const nlohmann::json& effect);
29 static std::unique_ptr<Effect> makeGainActionsEffect(const nlohmann::json& effect);
30 static std::unique_ptr<Effect> makeDrawCardsEffect(const nlohmann::json& effect);
31};
32
33#endif // EFFECTFACTORY_H
Definition: effectFactory.h:15
EffectFactory()
Definition: effectFactory.cpp:10
std::vector< std::unique_ptr< Effect > > makeEffectList(const nlohmann::json &effectList)
Definition: effectFactory.cpp:19
Target
Logical target selector used during effect resolution.
Definition: combatTarget.h:14