importonly struct DelayID
{
}

function GetInvalidDelayID() : DelayID
{
	var invalidID : DelayID;
	return invalidID;
}

import operator==( a : DelayID, b : DelayID ) : Bool;
import operator!=( a : DelayID, b : DelayID ) : Bool;

importonly abstract class IDelaySystem extends IGameSystem
{
}

struct PSOwnerData
{
	persistent var id : PersistentID;
	persistent var className : CName;
}

import enum gameTickableEventState
{
	Idle,
	FirstTick,
	NormalTick,
	LastTick,
	Canceled,
}

importonly class TickableEvent extends Event
{
	import var state : gameTickableEventState;

	public import function GetState() : gameTickableEventState;
	public import function GetProgress() : Float;
}

import class DelayCallback extends IScriptable
{
	public virtual function Call();
}

import enum gameScriptTaskExecutionStage
{
	Any,
	PostPhysics,
}

import class ScriptTaskData extends IScriptable
{
}

importonly final class DelaySystem extends IDelaySystem
{
	public import function DelayEvent( entity : weak< Entity >, eventToDelay : Event, timeToDelay : Float, optional isAffectedByTimeDilation : Bool ) : DelayID;
	public import function DelayCallback( delayCallback : DelayCallback, timeToDelay : Float, optional isAffectedByTimeDilation : Bool ) : DelayID;
	public import function DelayPSEvent( psID : PersistentID, classType : CName, eventToDelay : Event, timeToDelay : Float, optional isAffectedByTimeDilation : Bool ) : DelayID;
	public import function DelayScriptableSystemRequest( systemName : CName, requestToDelay : ScriptableSystemRequest, timeToDelay : Float, optional isAffectedByTimeDilation : Bool ) : DelayID;
	public import function DelayEventNextFrame( entity : weak< Entity >, eventToDelay : Event );
	public import function DelayCallbackNextFrame( delayCallback : DelayCallback );
	public import function DelayPSEventNextFrame( psID : PersistentID, classType : CName, eventToDelay : Event );
	public import function DelayScriptableSystemRequestNextFrame( systemName : CName, requestToDelay : ScriptableSystemRequest );
	public import function CancelDelay( delayID : DelayID );
	public import function CancelCallback( delayID : DelayID );
	public import function TickOnEvent( entity : weak< Entity >, eventToTick : TickableEvent, duration : Float ) : DelayID;
	public import function CancelTick( delayID : DelayID );
	public import function QueueTask( caller : IScriptable, data : ScriptTaskData, funtionName : CName, executionStage : gameScriptTaskExecutionStage );
	public import function GetRemainingDelayTime( delayID : DelayID ) : Float;
}

