object type interface
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
27d603519b
commit
d33190b204
2 changed files with 55 additions and 13 deletions
|
|
@ -9,39 +9,40 @@ IKARUS_BEGIN_HEADER
|
|||
/// @{
|
||||
|
||||
/// \brief The type of a folder.
|
||||
/// \remark folders have the first bit set and then mirror the object type of the underlying object
|
||||
/// \remark These values are identical to the associated values of IkarusObjectType.
|
||||
enum IkarusFolderType {
|
||||
/// \brief Not a folder or no folder.
|
||||
IkarusFolderType_None = 0,
|
||||
/// \brief An IkarusBlueprintFolder
|
||||
IkarusFolderType_BlueprintFolder = 0b1000'0001,
|
||||
IkarusFolderType_BlueprintFolder = 17,
|
||||
/// \brief An IkarusPropertyFolder
|
||||
IkarusFolderType_PropertyFolder = 0b1000'0010,
|
||||
IkarusFolderType_PropertyFolder = 18,
|
||||
/// \brief An IkarusEntityFolder
|
||||
IkarusFolderType_EntityFolder = 0b1000'0011,
|
||||
IkarusFolderType_EntityFolder = 19,
|
||||
};
|
||||
|
||||
/// \brief The type of an object.
|
||||
/// \remark folders have the first bit set and then mirror the object type of the underlying object
|
||||
/// \remark Folders have the 4th bit set.
|
||||
enum IkarusObjectType {
|
||||
/// \brief Not an object or no object.
|
||||
IkarusObjectType_None = 0,
|
||||
/// \brief An IkarusBlueprint.
|
||||
IkarusObjectType_Blueprint = 0b0000'0001,
|
||||
IkarusObjectType_Blueprint = 1,
|
||||
/// \brief An IkarusProperty.
|
||||
IkarusObjectType_Property = 0b0000'0010,
|
||||
IkarusObjectType_Property = 2,
|
||||
/// \brief An IkarusEntity.
|
||||
IkarusObjectType_Entity = 0b0000'0011,
|
||||
IkarusObjectType_Entity = 3,
|
||||
/// \brief An IkarusBlueprintFolder
|
||||
IkarusObjectType_BlueprintFolder = 0b1000'0001,
|
||||
IkarusObjectType_BlueprintFolder = IkarusFolderType_BlueprintFolder,
|
||||
/// \brief An IkarusPropertyFolder
|
||||
IkarusObjectType_PropertyFolder = 0b1000'0010,
|
||||
IkarusObjectType_PropertyFolder = IkarusFolderType_PropertyFolder,
|
||||
/// \brief An IkarusEntityFolder
|
||||
IkarusObjectType_EntityFolder = 0b1000'0011,
|
||||
IkarusObjectType_EntityFolder = IkarusFolderType_EntityFolder,
|
||||
};
|
||||
|
||||
// because of the nature of bitsets, the largest possible object-type is 31
|
||||
/// \brief A bitset of IkarusObjectType%s.
|
||||
enum ObjectTypes {
|
||||
enum IkarusObjectTypes {
|
||||
/// \brief No object type.
|
||||
IkarusObjectTypes_None = 0,
|
||||
/// \brief An IkarusBlueprint.
|
||||
|
|
@ -58,6 +59,15 @@ enum ObjectTypes {
|
|||
IkarusObjectTypes_EntityFolder = 1 << IkarusObjectType_EntityFolder,
|
||||
};
|
||||
|
||||
/// \brief Converts an IkarusFolderType to an IkarusObjectType.
|
||||
/// \param type The IkarusFolderType to convert.
|
||||
/// \return The converted IkarusObjectType, representing the folder type.
|
||||
IKA_API IkarusObjectType ikarus_folder_type_to_object_type(IkarusFolderType type);
|
||||
/// \brief Converts an IkarusObjectType to a bitset of IkarusObjectTypes.
|
||||
/// \param type The IkarusObjectType to convert.
|
||||
/// \return The converted IkarusObjectTypes, representing the object type.
|
||||
IKA_API IkarusObjectTypes ikarus_object_type_to_bitset(IkarusObjectType type);
|
||||
|
||||
// @}
|
||||
|
||||
IKARUS_END_HEADER
|
||||
IKARUS_END_HEADER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue