intermediate commit
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
52580a4382
commit
2ab0109355
37 changed files with 131 additions and 1544 deletions
|
|
@ -1,8 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/objects/blueprint.h>
|
||||
#include <id.hpp>
|
||||
|
||||
/// \private
|
||||
struct IkarusBlueprint {
|
||||
struct IkarusProject * project;
|
||||
IkarusId id;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/objects/entity.h>
|
||||
#include <id.hpp>
|
||||
|
||||
/// \private
|
||||
struct IkarusEntity {
|
||||
struct IkarusProject * project;
|
||||
IkarusId id;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
#include "ikarus/objects/object.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <objects/object.hpp>
|
||||
|
||||
IkarusObjectType ikarus_object_get_type(IkarusObject const * object) {
|
||||
return object->type;
|
||||
}
|
||||
|
||||
TEST_CASE("object_type", "[object]") {
|
||||
auto types = {
|
||||
IkarusObjectType_Blueprint,
|
||||
IkarusObjectType_Property,
|
||||
IkarusObjectType_Entity,
|
||||
IkarusObjectType_BlueprintFolder,
|
||||
IkarusObjectType_PropertyFolder,
|
||||
IkarusObjectType_EntityFolder,
|
||||
};
|
||||
|
||||
for (auto type : types) {
|
||||
auto object = IkarusObject{.type = type};
|
||||
REQUIRE(ikarus_object_get_type(&object) == type);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,14 +2,12 @@
|
|||
|
||||
#include <variant>
|
||||
|
||||
#include <folders/blueprint_folder.hpp>
|
||||
#include <folders/entity_folder.hpp>
|
||||
#include <folders/property_folder.hpp>
|
||||
#include <objects/blueprint.hpp>
|
||||
#include <objects/entity.hpp>
|
||||
#include <objects/property.hpp>
|
||||
|
||||
struct IkarusObject {
|
||||
std::variant<IkarusBlueprint, IkarusProperty, IkarusEntity, IkarusBlueprintFolder, IkarusPropertyFolder, IkarusEntityFolder>
|
||||
data;
|
||||
union IkarusObject {
|
||||
IkarusBlueprint blueprint;
|
||||
IkarusEntity entity;
|
||||
IkarusProperty property;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/objects/property.h>
|
||||
#include <id.hpp>
|
||||
|
||||
/// \private
|
||||
struct IkarusProperty {
|
||||
struct IkarusProject * project;
|
||||
IkarusId id;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue