diff options
Diffstat (limited to 'TileBehavior.h')
-rw-r--r-- | TileBehavior.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/TileBehavior.h b/TileBehavior.h index 33cd795..b79e7f5 100644 --- a/TileBehavior.h +++ b/TileBehavior.h @@ -1,21 +1,24 @@ #pragma once -#include <map> #include <string> +#include <memory> -#include "TileBehavior.h" - -class TileBehaviorFactory { - typedef std::map<std::string, TileBehavior *> TileBehaviorCollection; +class Tile; +class Museum; +class Artist; +class TileBehavior { public: - static TileBehavior & get_strategy(std::string); - static void register_strategy(std::string, TileBehavior *); + virtual void step(Artist *); + virtual void update(Tile &) = 0; + virtual std::unique_ptr<TileBehavior> clone(Museum & m) = 0; + +protected: + TileBehavior(const std::string type); + TileBehavior() = default; -private: - static TileBehaviorCollection & get_collection() { - static TileBehaviorCollection c = {}; - return c; - } +protected: + unsigned int interactions = 0; + Museum * museum = nullptr; }; |