import struct RegisterNewAbilityCooldownRequest
{
	import var owner : weak< Entity >;
	import var ownerItemId : ItemID;
	import var ownerRecord : TweakDBID;
	import var cooldownName : CName;
	import var duration : Float;
	import var type : gamedataStatType;
	import var modifiable : Bool;
	import var abilityType : gamedataStatType;
}

import struct RegisterNewCooldownRequest
{
	import var owner : weak< Entity >;
	import var ownerItemId : ItemID;
	import var ownerRecord : TweakDBID;
	import var cooldownName : CName;
	import var duration : Float;
	import var type : gamedataStatType;
	import var modifiable : Bool;
	import var affectedByTimeDilation : Bool;
}

import struct RegisterCooldownFromRecordRequest
{
	import var owner : weak< Entity >;
	import var ownerItemId : ItemID;
	import var ownerRecord : TweakDBID;
	import var cooldownRecord : Cooldown_Record;
}

class RemoveCooldownRequest extends ScriptableSystemRequest
{
	var cid : Int32;
}

importonly abstract class ICooldownSystem extends IGameSystem
{
	public import function DoesCooldownExist( id : Int32 ) : Bool;
	public import function GetCIDByOwnerAndName( owner : weak< Entity >, cdName : CName ) : Int32;
	public import function GetCIDByRecord( owner : weak< Entity >, record : TweakDBID ) : Int32;
	public import function GetCIDByItemID( itemId : ItemID ) : Int32;
	public import function Register( request : ref< RegisterNewCooldownRequest > ) : Int32;
	public import function RegisterAbility( request : ref< RegisterNewAbilityCooldownRequest > ) : Int32;
	public import function RegisterFromRecord( request : ref< RegisterCooldownFromRecordRequest > ) : Int32;
	public import function Remove( id : Int32 ) : Bool;
}

struct SCooldown
{
	var delayId : DelayID;
	var removeId : DelayID;
	var cid : Int32;
	var cdName : CName;
	var owner : weak< Entity >;
	var ownerItemID : ItemID;
	var ownerRecord : TweakDBID;
	var duration : Float;
	var type : gamedataStatType;
	var durationMultiplier : Float;
	var modifiable : Bool;
	var affectedByTimeDilation : Bool;
	var abilityType : gamedataStatType;
	var statMod : gameStatModifierData;
}

class CSH
{

	public static function GetCooldownSystem( go : GameObject ) : ICooldownSystem
	{
		return GameInstance.GetCooldownSystem( go.GetGame() );
	}

}

