finalise interface & documentation
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
c5157bd849
commit
52580a4382
56 changed files with 2074 additions and 780 deletions
8
src/objects/blueprint.hpp
Normal file
8
src/objects/blueprint.hpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/objects/blueprint.h>
|
||||
|
||||
/// \private
|
||||
struct IkarusBlueprint {
|
||||
IkarusId id;
|
||||
};
|
||||
8
src/objects/entity.hpp
Normal file
8
src/objects/entity.hpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/objects/entity.h>
|
||||
|
||||
/// \private
|
||||
struct IkarusEntity {
|
||||
IkarusId id;
|
||||
};
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
#include "ikarus/objects/object.h"
|
||||
|
||||
#include <initializer_list>
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <ikarus/objects/object_type.h>
|
||||
#include <objects/object.hpp>
|
||||
|
||||
IkarusObjectType ikarus_object_get_type(IkarusObject object) {
|
||||
return object.type;
|
||||
IkarusObjectType ikarus_object_get_type(IkarusObject const * object) {
|
||||
return object->type;
|
||||
}
|
||||
|
||||
TEST_CASE("object_type", "[object]") {
|
||||
|
|
@ -22,6 +20,6 @@ TEST_CASE("object_type", "[object]") {
|
|||
|
||||
for (auto type : types) {
|
||||
auto object = IkarusObject{.type = type};
|
||||
REQUIRE(ikarus_object_get_type(object) == type);
|
||||
REQUIRE(ikarus_object_get_type(&object) == type);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
15
src/objects/object.hpp
Normal file
15
src/objects/object.hpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#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;
|
||||
};
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#include "ikarus/objects/object_type.h"
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <ikarus/folders/folder_type.h>
|
||||
|
||||
IkarusObjectType ikarus_folder_type_to_object_type(IkarusFolderType type) {
|
||||
return static_cast<IkarusObjectType>(type);
|
||||
}
|
||||
|
||||
TEST_CASE("folder_to_object_type_conversion", "[object_type]") {
|
||||
REQUIRE(ikarus_folder_type_to_object_type(IkarusFolderType_None) == IkarusObjectType_None);
|
||||
REQUIRE(ikarus_folder_type_to_object_type(IkarusFolderType_BlueprintFolder) == IkarusObjectType_BlueprintFolder);
|
||||
REQUIRE(ikarus_folder_type_to_object_type(IkarusFolderType_PropertyFolder) == IkarusObjectType_PropertyFolder);
|
||||
REQUIRE(ikarus_folder_type_to_object_type(IkarusFolderType_EntityFolder) == IkarusObjectType_EntityFolder);
|
||||
}
|
||||
8
src/objects/property.hpp
Normal file
8
src/objects/property.hpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <ikarus/objects/property.h>
|
||||
|
||||
/// \private
|
||||
struct IkarusProperty {
|
||||
IkarusId id;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue