1 #ifndef HB_OBJECT_TYPE_FACTORY
2 #define HB_OBJECT_TYPE_FACTORY
6 #include <unordered_map>
8 #include <tmxparser/Tmx.h>
9 #include "../Core/GameObject.h"
10 #include "../SFML/ClickableComponent.h"
11 #include "TmxVersion.h"
19 typedef void(*GameObjectFactory)(GameObject*,
const Tmx::Map*, int, int);
20 typedef std::function<void(GameObject*, const Tmx::Map*, int, int)> lambdaFactory;
26 static void registerFactory(
const std::string& type, lambdaFactory&& factory);
27 static void registerFactory(
const std::string& type, GameObjectFactory factory);
28 static void makeObject(
const Tmx::Map* map,
int obj_grp,
int obj);
31 static std::unordered_map<std::string, lambdaFactory> s_factory_table;
34 inline void TmxRegisterFactory(
const std::string& type, GameObjectFactory factory)
36 TmxObjectTypeFactory::registerFactory(type, factory);
39 inline void TmxRegisterFactory(
const std::string& type, lambdaFactory&& factory)
41 TmxObjectTypeFactory::registerFactory(type, std::move(factory));
Definition: TmxObjectTypeFactory.h:21
Definition: Box2DPlugin.h:6