importonly struct SquadOrder
{
	import var squadAction : CName;
	import var state : Uint32;
	import var id : Uint32;
}

importonly struct TacticRatio
{
	import var ratioSum : Float;
	import var reachSum : Float;
	import var area : Float;
}

import enum AICombatSectorType
{
	ToBackLeft,
	ToBackMid,
	ToBackRight,
	ToLeft,
	ToMid,
	ToRight,
	FromLeft,
	FromMid,
	FromRight,
	FromBackLeft,
	FromBackMid,
	FromBackRight,
	BeyondToLeft,
	BeyondToRight,
	BeyondFromLeft,
	BeyondFromRight,
	Unknown,
}

import enum AISquadType
{
	Community,
	Combat,
	Unknown,
}

importonly class CombatAlley extends IScriptable
{
	public import final function GetSector( pos : Vector4 ) : AICombatSectorType;
	public import final function GetDistanceFromSector( sector : AICombatSectorType, pos : Vector4 ) : Float;
	public import final function GetFurtherstMemberFromSector( sector : AICombatSectorType ) : Entity;
	public import final function GetClosestMemberFromSector( sector : AICombatSectorType ) : Entity;
	public import final function GetReferencePoint() : Vector4;
	public import final function GetTargetPoint() : Vector4;
}

importonly class SquadScriptInterface extends IScriptable
{
	public import final function GetName() : CName;
	public import final function GetTemplate() : CName;
	public import final function Join( et : Entity ) : Bool;
	public import final function Leave( et : Entity ) : Bool;
	public import final function OpenSquadAction( name : CName, et : Entity, timeout : Float ) : Bool;
	public import final function RefreshSquadAction( name : CName, et : Entity, timeout : Float ) : Bool;
	public import final function RevokeSquadAction( name : CName, et : Entity ) : Bool;
	public import final function TriggerEvaluation( name : CName, et : Entity ) : Bool;
	public import final function TriggerActivation( name : CName, et : Entity ) : Bool;
	public import final function TriggerDeactivation( name : CName, et : Entity ) : Bool;
	public import final function RequestOrder( sqAction : CName, et : Entity ) : Bool;
	public import final function GiveOrder( sqAction : CName, et : Entity ) : Uint32;
	public import final function AckOrder( sqAction : CName, et : Entity ) : Bool;
	public import final function RevokeOrder( sqAction : CName, et : Entity ) : Bool;
	public import final function Commit( sqAction : CName, et : Entity ) : Bool;
	public import final function ReportDone( sqAction : CName, et : Entity ) : Bool;
	public import final function ReportFail( sqAction : CName, et : Entity ) : Bool;
	public import final function ListMembers() : array< Entity >;
	public import final function ListMembersWeak() : array< weak< Entity > >;
	public import final function ListMembersWithSquadActionWeak( sqAction : CName ) : array< weak< Entity > >;
	public import final function GetMembersCount() : Uint32;
	public import final function IsSquadActionOpen( sqAction : CName, et : Entity ) : Bool;
	public import final function HasOrderBySquadAction( sqAction : CName, et : Entity ) : Bool;
	public import final function HasAcknowledgedOrderBySquadAction( sqAction : CName, et : Entity ) : Bool;
	public import final function GetOrderById( orderId : Uint32 ) : SquadOrder;
	public import final function GetAllOrders( et : Entity ) : array< Uint32 >;
	public import final function GetAllCommitedOrders( et : Entity ) : array< Uint32 >;
	public import final function GetAllAcknowledgedOrders( et : Entity ) : array< Uint32 >;
	public import final function GetSquadType() : AISquadType;
	public import final function LockAccess() : Bool;
	public import final function UnlockAccess() : Bool;
	public import final function GuardedCall( callThisFunction : CName );
}

importonly class CombatSquadScriptInterface extends SquadScriptInterface
{
	public import final function GetDefensiveCombatAlley() : CombatAlley;
	public import final function GetOffensiveCombatAlley() : CombatAlley;
	public import final function AddEnemy( et : Entity ) : Bool;
	public import final function RemoveEnemy( et : Entity ) : Bool;
	public import final function EnemyList() : array< Entity >;
	public import final function EnemyListWeak() : array< weak< Entity > >;
	public import final function IsEnemy( potentialEnemy : Entity ) : Bool;
	public import final function GetEnemiesCount() : Uint32;
	public import final function SetAsEnemyAttacker( squadMember : Entity, enemy : Entity );
	public import final function GetEnemyAttackersCount( enemy : Entity ) : Uint32;
	public import final function RegisterTactic( sqAction : CName, sectors : array< AICombatSectorType >, alley : CombatAlley, timeout : Float );
	public import final function UnregisterTactic( sqAction : CName );
	public import final function ValidCombatSquad() : Bool;
	public import final function GetTacticRatio() : TacticRatio;
	public import final function PullEnemies( sourceSquadName : CName );
}

importonly class SquadMemberComponent extends GameComponent
{
	public import final function MySquad( sqtype : AISquadType ) : SquadScriptInterface;
	public import final function MySquadName( sqtype : AISquadType ) : CName;
	public import final function MySquadNameCurrentOrRecent( sqtype : AISquadType ) : CName;
	public import final function MySquads() : array< SquadScriptInterface >;
	public import final function MySquadsNames() : array< CName >;
	public import final function MySquadsNamesCurrentOrRecent() : array< CName >;
	public import final function FindSquad( sqName : CName ) : SquadScriptInterface;
	public import final function GetGameTime() : Float;
}

importonly struct EnumNameToIndexCache
{
	public import static function Rebuild( cache : ref< EnumNameToIndexCache >, enumTypeName : CName ) : Bool;
	public import static function GetIndex( cache : ref< EnumNameToIndexCache >, enumValueName : CName, out index : Int32 ) : Bool;
}

