// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Level/Types.h"
#include "Engine/Core/Collections/Array.h"
///
/// Scene gameplay updating helper subsystem that boosts the level ticking by providing efficient objects cache.
///
class FLAXENGINE_API SceneTicking
{
public:
///
/// Tick function type.
///
struct FLAXENGINE_API Tick
{
typedef void (*Signature)();
typedef void (*SignatureObj)(void*);
template
static void MethodCaller(void* callee)
{
(static_cast(callee)->*Method)();
}
void* Callee;
SignatureObj FunctionObj;
template
void Bind(T* callee)
{
Callee = callee;
FunctionObj = &MethodCaller;
}
FORCE_INLINE void Call() const
{
(*FunctionObj)(Callee);
}
};
///
/// Ticking data container.
///
class FLAXENGINE_API TickData
{
public:
Array