4#ifndef LODESTONE_REFLECTIVEPROPERTIES_H
5#define LODESTONE_REFLECTIVEPROPERTIES_H
17#define ADD_FIELD_PROPERTY(n, f) \
19 return (typeid(decltype(f)) == typeid(f)) \
21 lodestone::level::properties::TemplatedProperty<decltype(f)>>( \
34 virtual std::unique_ptr<AbstractProperty>
38 std::unique_ptr<TemplatedProperty<T>>
getProperty(
const std::string &name) {
43 std::unique_ptr<TemplatedProperty<T>>
getPropertyOr(
const std::string &name, T value) {
45 if (prop ==
nullptr) {
46 return std::make_unique<TemplatedProperty<T>>(value);
49 return std::move(prop);
static std::unique_ptr< To > dynamic_unique_pointer_cast(std::unique_ptr< From > ptr)
Definition ReflectiveProperties.h:15
virtual ~ReflectiveProperties()=default
virtual std::unique_ptr< AbstractProperty > getProperty(const std::string &name)
Definition ReflectiveProperties.cpp:6
std::unique_ptr< TemplatedProperty< T > > getPropertyOr(const std::string &name, T value)
Definition ReflectiveProperties.h:43
std::unique_ptr< TemplatedProperty< T > > getProperty(const std::string &name)
Definition ReflectiveProperties.h:38
Definition ObjectDefinition.cpp:6