operator==( hudInstance1 : ModuleInstance, hudInstance2 : ModuleInstance ) : Bool
{
	if( hudInstance1 && hudInstance2 )
	{
		return hudInstance1.GetEntityID() == hudInstance2.GetEntityID();
	}
	return false;
}

operator>=( activeMode1 : ActiveMode, activeMode2 : ActiveMode ) : Bool
{
	if( ( ( Int32 )( activeMode1 ) ) >= ( ( Int32 )( activeMode2 ) ) )
	{
		return true;
	}
	return false;
}

operator<=( activeMode1 : ActiveMode, activeMode2 : ActiveMode ) : Bool
{
	if( ( ( Int32 )( activeMode1 ) ) <= ( ( Int32 )( activeMode2 ) ) )
	{
		return true;
	}
	return false;
}

enum HUDActorType
{
	UNINITIALIZED = 0,
	GAME_OBJECT = 1,
	VEHICLE = 2,
	DEVICE = 3,
	BODY_DISPOSAL_DEVICE = 4,
	PUPPET = 5,
	ITEM = 6,
}

enum HUDActorStatus
{
	UNINITIALIZED = 0,
	REGISTERED = 1,
	ACTIVE = 2,
}

enum ActorVisibilityStatus
{
	OUTSIDE_CAMERA = 0,
	IN_CAMERA = 1,
	VISIBLE = 2,
	LOOKEDAT = 3,
}

struct HUDClueData
{
	var isClue : Bool;
	var clueGroupID : CName;
}

class HUDManagerRegistrationTaskData extends ScriptTaskData
{
	var shouldRegister : Bool;
}

class HUDManagerRequest extends ScriptableSystemRequest
{
	var ownerID : EntityID;

	public const function IsValid() : Bool
	{
		if( EntityID.IsDefined( ownerID ) )
		{
			return true;
		}
		return false;
	}

}

class HUDManagerRegistrationRequest extends HUDManagerRequest
{
	var isRegistering : Bool;
	var type : HUDActorType;

	public function SetProperties( owner : GameObject, shouldRegister : Bool )
	{
		ownerID = owner.GetEntityID();
		isRegistering = shouldRegister;
		if( ( ( ScriptedPuppet )( owner ) ) )
		{
			type = HUDActorType.PUPPET;
		}
		else if( ( ( DisposalDevice )( owner ) ) )
		{
			type = HUDActorType.BODY_DISPOSAL_DEVICE;
		}
		else if( ( ( Device )( owner ) ) )
		{
			type = HUDActorType.DEVICE;
		}
		else if( ( ( VehicleObject )( owner ) ) )
		{
			type = HUDActorType.VEHICLE;
		}
		else if( ( ( gameLootObject )( owner ) ) )
		{
			type = HUDActorType.ITEM;
		}
		else if( ( ( GameObject )( owner ) ) )
		{
			type = HUDActorType.GAME_OBJECT;
		}
		else
		{
			type = HUDActorType.UNINITIALIZED;
		}
	}

}

class HUDManagerAssociationRequest extends HUDManagerRequest
{
	var associatedID : EntityID;
	var isRegistering : Bool;
}

class RevealQuickhackMenu extends HUDManagerRequest
{
	var shouldOpenWheel : Bool;
}

class RevealStatusNotification extends HUDManagerRequest
{
	var isRevealed : Bool;
}

class TagStatusNotification extends HUDManagerRequest
{
	var isTagged : Bool;
}

class ClueStatusNotification extends HUDManagerRequest
{
	var isClue : Bool;
	var clueGroupID : CName;
}

class ClueLockNotification extends HUDManagerRequest
{
	var isLocked : Bool;
}

class RefreshActorRequest extends HUDManagerRequest
{
	private var actorUpdateData : HUDActorUpdateData;
	private var requestedModules : array< weak< HUDModule > >;

	public static function Construct( requesterID : EntityID, optional updateData : HUDActorUpdateData, optional suggestedModules : array< weak< HUDModule > > ) : RefreshActorRequest
	{
		var request : RefreshActorRequest;
		var i : Int32;
		request = new RefreshActorRequest;
		request.ownerID = requesterID;
		if( updateData )
		{
			request.actorUpdateData = updateData;
		}
		for( i = 0; i < suggestedModules.Size(); i += 1 )
		{
			if( suggestedModules[ i ] )
			{
				request.requestedModules.PushBack( suggestedModules[ i ] );
			}
		}
		return request;
	}

	public const function GetActorUpdateData() : HUDActorUpdateData
	{
		return actorUpdateData;
	}

	public const function GetRequestedModules() : array< weak< HUDModule > >
	{
		return requestedModules;
	}

}

class ResolveQuickHackRadialRequest extends HUDManagerRequest
{
}

class HUDActorUpdateData extends IScriptable
{
	var updateVisibility : Bool;
	var visibilityValue : ActorVisibilityStatus;
	var updateIsRevealed : Bool;
	var isRevealedValue : Bool;
	var updateIsTagged : Bool;
	var isTaggedValue : Bool;
	var updateClueData : Bool;
	var clueDataValue : HUDClueData;
	var updateIsRemotelyAccessed : Bool;
	var isRemotelyAccessedValue : Bool;
	var updateCanOpenScannerInfo : Bool;
	var canOpenScannerInfoValue : Bool;
	var updateIsInIconForcedVisibilityRange : Bool;
	var isInIconForcedVisibilityRangeValue : Bool;
	var updateIsIconForcedVisibleThroughWalls : Bool;
	var isIconForcedVisibleThroughWallsValue : Bool;
}

import class HUDActor extends IScriptable
{
	private var entityID : EntityID;
	private var type : HUDActorType;
	private var status : HUDActorStatus;
	private var visibility : ActorVisibilityStatus;
	private var activeModules : array< weak< HUDModule > >;
	private var isRevealed : Bool;
	private var isTagged : Bool;
	private var clueData : HUDClueData;
	private var isRemotelyAccessed : Bool;
	private var canOpenScannerInfo : Bool;
	private var isInIconForcedVisibilityRange : Bool;
	private var isIconForcedVisibleThroughWalls : Bool;
	private var shouldRefreshQHack : Bool;
	default shouldRefreshQHack = true;

	public static function Construct( self : HUDActor, entityID : EntityID, type : HUDActorType, status : HUDActorStatus, visibility : ActorVisibilityStatus )
	{
		self.entityID = entityID;
		self.type = type;
		self.status = status;
		self.visibility = visibility;
	}

	public function UpdateActorData( updateData : HUDActorUpdateData )
	{
		if( updateData == NULL )
		{
			return;
		}
		if( updateData.updateVisibility )
		{
			visibility = updateData.visibilityValue;
		}
		if( updateData.updateIsRevealed )
		{
			isRevealed = updateData.isRevealedValue;
		}
		if( updateData.updateIsTagged )
		{
			isTagged = updateData.isTaggedValue;
		}
		if( updateData.updateClueData )
		{
			clueData = updateData.clueDataValue;
		}
		if( updateData.updateIsRemotelyAccessed )
		{
			isRemotelyAccessed = updateData.isRemotelyAccessedValue;
		}
		if( updateData.updateCanOpenScannerInfo )
		{
			canOpenScannerInfo = updateData.canOpenScannerInfoValue;
		}
		if( updateData.updateIsInIconForcedVisibilityRange )
		{
			isInIconForcedVisibilityRange = updateData.isInIconForcedVisibilityRangeValue;
		}
		if( updateData.updateIsIconForcedVisibleThroughWalls )
		{
			isIconForcedVisibleThroughWalls = updateData.isIconForcedVisibleThroughWallsValue;
		}
	}

	public function AddModule( module : HUDModule )
	{
		var i : Int32;
		for( i = 0; i < activeModules.Size(); i += 1 )
		{
			if( activeModules[ i ] == module )
			{
				return;
			}
		}
		activeModules.PushBack( module );
	}

	public function RemoveModule( module : HUDModule )
	{
		var i : Int32;
		for( i = 0; i < activeModules.Size(); i += 1 )
		{
			if( activeModules[ i ] == module )
			{
				activeModules.Erase( i );
				return;
			}
		}
	}

	public function SetStatus( newStatus : HUDActorStatus )
	{
		status = newStatus;
	}

	public function SetRemotelyAccessed( value : Bool )
	{
		isRemotelyAccessed = value;
	}

	public function SetRevealed( value : Bool )
	{
		isRevealed = value;
	}

	public function SetTagged( value : Bool )
	{
		isTagged = value;
	}

	public function SetClue( value : Bool )
	{
		clueData.isClue = value;
	}

	public function SetClueGroup( value : CName )
	{
		clueData.clueGroupID = value;
	}

	public function SetCanOpenScannerInfo( value : Bool )
	{
		canOpenScannerInfo = value;
	}

	public function SetIsInIconForcedVisibilityRange( value : Bool )
	{
		isInIconForcedVisibilityRange = value;
	}

	public function SetIsIconForcedVisibileThroughWalls( value : Bool )
	{
		isIconForcedVisibleThroughWalls = value;
	}

	public function SetShouldRefreshQHack( value : Bool )
	{
		shouldRefreshQHack = value;
	}

	public const function GetEntityID() : EntityID
	{
		return entityID;
	}

	public const function GetType() : HUDActorType
	{
		return type;
	}

	public const function GetStatus() : HUDActorStatus
	{
		return status;
	}

	public const function GetVisibility() : ActorVisibilityStatus
	{
		return visibility;
	}

	public const function IsRevealed() : Bool
	{
		return isRevealed;
	}

	public const function IsTagged() : Bool
	{
		return isTagged;
	}

	public const function IsClue() : Bool
	{
		return clueData.isClue;
	}

	public const function IsGrouppedClue() : Bool
	{
		return IsNameValid( clueData.clueGroupID );
	}

	public const function IsRemotelyAccessed() : Bool
	{
		return isRemotelyAccessed;
	}

	public const function CanOpenScannerInfo() : Bool
	{
		return canOpenScannerInfo;
	}

	public const function IsInIconForcedVisibilityRange() : Bool
	{
		return isInIconForcedVisibilityRange;
	}

	public const function IsIconForcedVisibileThroughWalls() : Bool
	{
		return isIconForcedVisibleThroughWalls;
	}

	public const function GetShouldRefreshQHack() : Bool
	{
		return shouldRefreshQHack;
	}

	public const function GetActiveModules() : array< weak< HUDModule > >
	{
		return activeModules;
	}

}

class GAMEOBJECT_Actor extends HUDActor
{
	default type = HUDActorType.GAME_OBJECT;
}

class VEHICLE_Actor extends HUDActor
{
	default type = HUDActorType.VEHICLE;
}

class DEVICE_Actor extends HUDActor
{
	default type = HUDActorType.DEVICE;
}

class PUPPET_ACtor extends HUDActor
{
	default type = HUDActorType.PUPPET;
}

class DEBUG_actorsClassNamesCount
{
	var className : CName;
	var count : Int32;
}

