implement IkarusPropertySource and switch to cppbase::overloaded
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
700d9a92f9
commit
8fa56decd0
10 changed files with 90 additions and 50 deletions
|
|
@ -1,16 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <variant>
|
||||
#include <boost/variant2.hpp>
|
||||
|
||||
#include <ikarus/objects/properties/property_source.h>
|
||||
|
||||
struct IkarusPropertySource {
|
||||
public:
|
||||
using Data = std::variant<IkarusBlueprint *, IkarusEntity *>;
|
||||
using Data = boost::variant2::variant<IkarusBlueprint *, IkarusEntity *>;
|
||||
|
||||
public:
|
||||
inline explicit IkarusPropertySource(Data data):
|
||||
_data{data} {}
|
||||
explicit IkarusPropertySource(Data data);
|
||||
|
||||
IkarusPropertySource(IkarusPropertySource const&) = default;
|
||||
IkarusPropertySource(IkarusPropertySource&&) = default;
|
||||
|
|
@ -18,13 +17,8 @@ public:
|
|||
IkarusPropertySource& operator=(IkarusPropertySource const&) = default;
|
||||
IkarusPropertySource& operator=(IkarusPropertySource&&) = default;
|
||||
|
||||
~IkarusPropertySource() = default;
|
||||
virtual ~IkarusPropertySource() = default;
|
||||
|
||||
public:
|
||||
[[nodiscard]] inline Data const& get_data() const {
|
||||
return _data;
|
||||
}
|
||||
|
||||
private:
|
||||
std::variant<IkarusBlueprint *, IkarusEntity *> _data;
|
||||
Data data;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue