add src/ikarus subdir and make names unique for objects per scope
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
ced123b628
commit
9f943cc6a2
51 changed files with 590 additions and 735 deletions
|
|
@ -1,58 +0,0 @@
|
|||
#include "property_source.hpp"
|
||||
|
||||
#include <boost/functional/overloaded_function.hpp>
|
||||
|
||||
#include <objects/blueprint.hpp>
|
||||
#include <objects/entity.hpp>
|
||||
#include <cppbase/templates.hpp>
|
||||
|
||||
IkarusPropertySource::IkarusPropertySource(Data data):
|
||||
data{data} {}
|
||||
|
||||
IkarusId IkarusPropertySource::get_id() const {
|
||||
return boost::variant2::visit(
|
||||
cppbase::overloaded {
|
||||
[](IkarusBlueprint const * blueprint) { return blueprint->id; },
|
||||
[](IkarusEntity const * entity) { return entity->id; }
|
||||
},
|
||||
data
|
||||
);
|
||||
}
|
||||
|
||||
IkarusPropertySource * ikarus_property_source_create_blueprint(IkarusBlueprint * blueprint) {
|
||||
return new IkarusPropertySource{blueprint};
|
||||
}
|
||||
|
||||
IkarusPropertySource * ikarus_property_source_create_entity(IkarusEntity * entity) {
|
||||
return new IkarusPropertySource{entity};
|
||||
}
|
||||
|
||||
void ikarus_property_source_visit(
|
||||
struct IkarusPropertySource * property_source,
|
||||
void (*blueprint_visitor)(struct IkarusBlueprint *, void *),
|
||||
void (*entity_visitor)(struct IkarusEntity *, void *),
|
||||
void * user_data
|
||||
) {
|
||||
boost::variant2::visit(
|
||||
boost::make_overloaded_function(
|
||||
[blueprint_visitor, user_data](IkarusBlueprint * blueprint) { blueprint_visitor(blueprint, user_data); },
|
||||
[entity_visitor, user_data](IkarusEntity * entity) { entity_visitor(entity, user_data); }
|
||||
),
|
||||
property_source->data
|
||||
);
|
||||
}
|
||||
|
||||
void ikarus_property_source_visit_const(
|
||||
struct IkarusPropertySource const * property_source,
|
||||
void (*blueprint_visitor)(struct IkarusBlueprint const *, void *),
|
||||
void (*entity_visitor)(struct IkarusEntity const *, void *),
|
||||
void * user_data
|
||||
) {
|
||||
boost::variant2::visit(
|
||||
boost::make_overloaded_function(
|
||||
[blueprint_visitor, user_data](IkarusBlueprint const * blueprint) { blueprint_visitor(blueprint, user_data); },
|
||||
[entity_visitor, user_data](IkarusEntity const * entity) { entity_visitor(entity, user_data); }
|
||||
),
|
||||
property_source->data
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue