46 lines
1.5 KiB
C
46 lines
1.5 KiB
C
#pragma once
|
|
|
|
// IMPLEMENTATION_DETAIL_OBJECT_SCOPES
|
|
|
|
/// \file object_scope.h
|
|
/// \author Folling <folling@ikarus.world>
|
|
|
|
#include <ikarus/macros.h>
|
|
|
|
/// \defgroup object_scopes Object Scopes
|
|
/// \brief Scopes define where objects belong to.
|
|
/// \details They are required to differentiate between different types of objects with NULL as their parent.
|
|
/// @{
|
|
|
|
IKARUS_BEGIN_HEADER
|
|
|
|
/// \brief The scope of an object.
|
|
struct IkarusObjectScope;
|
|
|
|
/// \brief The type of an object scope.
|
|
enum IkarusObjectScopeType {
|
|
/// \brief The scope is a blueprint scope.
|
|
IkarusObjectScopeType_Blueprint = 1,
|
|
/// \brief The scope is a property scope.
|
|
IkarusObjectScopeType_Property = 2,
|
|
/// \brief The scope is an entity scope.
|
|
IkarusObjectScopeType_Entity = 3
|
|
};
|
|
|
|
/// \brief Visits an object scope, calling the appropriate function.
|
|
/// \param scope The scope to visit.
|
|
/// \param blueprint_visitor The function to call if the scope is an #IkarusBlueprintScope.
|
|
/// \param property_visitor The function to call if the scope is an #IkarusPropertyScope.
|
|
/// \param entity_visitor The function to call if the scope is an #IkarusEntityScope.
|
|
/// \remark function pointers may be null in which case they are not called.
|
|
IKA_API void ikarus_object_scope_visit(
|
|
IkarusObjectScope * scope,
|
|
void (*blueprint_visitor)(struct IkarusBlueprintScope *, void *),
|
|
void (*property_visitor)(struct IkarusPropertyScope *, void *),
|
|
void (*entity_visitor)(struct IkarusEntityScope *, void *),
|
|
void * data
|
|
);
|
|
|
|
/// @}
|
|
|
|
IKARUS_END_HEADER
|