|
|
|
@ -0,0 +1,29 @@ |
|
|
|
#include "characterproperty.h"
|
|
|
|
|
|
|
|
CharacterProperty::CharacterProperty() |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
std::optional<CharacterProperty::StringType> CharacterProperty::toString() const |
|
|
|
{ |
|
|
|
if(m_valueType != Type::string) |
|
|
|
return std::nullopt; |
|
|
|
|
|
|
|
return std::make_optional(m_valueString); |
|
|
|
} |
|
|
|
|
|
|
|
std::optional<CharacterProperty::IntegerType> CharacterProperty::toInt() const |
|
|
|
{ |
|
|
|
if(m_valueType != Type::integer) |
|
|
|
return std::nullopt; |
|
|
|
|
|
|
|
return std::make_optional(m_valueInt); |
|
|
|
} |
|
|
|
|
|
|
|
std::optional<CharacterProperty::FloatingType> CharacterProperty::toFloat() const |
|
|
|
{ |
|
|
|
if(m_valueType != Type::floating_point) |
|
|
|
return std::nullopt; |
|
|
|
|
|
|
|
return std::make_optional(m_valueFloat); |
|
|
|
} |