Fix 3000 errors
This commit is contained in:
@@ -12,10 +12,10 @@ namespace Content.Server.AI.Operators.Combat.Melee
|
||||
private readonly float _burstTime;
|
||||
private float _elapsedTime;
|
||||
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _target;
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
|
||||
public SwingMeleeWeaponOperator(IEntity owner, IEntity target, float burstTime = 1.0f)
|
||||
public SwingMeleeWeaponOperator(EntityUid owner, EntityUid target, float burstTime = 1.0f)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
|
||||
@@ -11,11 +11,11 @@ namespace Content.Server.AI.Operators.Combat.Melee
|
||||
private readonly float _burstTime;
|
||||
private float _elapsedTime;
|
||||
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _target;
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
private UnarmedCombatComponent? _unarmedCombat;
|
||||
|
||||
public UnarmedCombatOperator(IEntity owner, IEntity target, float burstTime = 1.0f)
|
||||
public UnarmedCombatOperator(EntityUid owner, EntityUid target, float burstTime = 1.0f)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
/// </summary>
|
||||
public sealed class CloseLastStorageOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private IEntity? _target;
|
||||
private readonly EntityUid _owner;
|
||||
private EntityUid _target;
|
||||
|
||||
public CloseLastStorageOperator(IEntity owner)
|
||||
public CloseLastStorageOperator(EntityUid owner)
|
||||
{
|
||||
_owner = owner;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
|
||||
_target = blackboard.GetState<LastOpenedStorageState>().GetValue();
|
||||
|
||||
return _target != null;
|
||||
return _target != default;
|
||||
}
|
||||
|
||||
public override bool Shutdown(Outcome outcome)
|
||||
@@ -48,13 +48,13 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
|
||||
var blackboard = UtilityAiHelpers.GetBlackboard(_owner);
|
||||
|
||||
blackboard?.GetState<LastOpenedStorageState>().SetValue(null);
|
||||
blackboard?.GetState<LastOpenedStorageState>().SetValue(default);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override Outcome Execute(float frameTime)
|
||||
{
|
||||
if (_target == null || !_owner.InRangeUnobstructed(_target, popup: true))
|
||||
if (_target == default || !_owner.InRangeUnobstructed(_target, popup: true))
|
||||
{
|
||||
return Outcome.Failed;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
{
|
||||
public class DropEntityOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _entity;
|
||||
public DropEntityOperator(IEntity owner, IEntity entity)
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _entity;
|
||||
public DropEntityOperator(EntityUid owner, EntityUid entity)
|
||||
{
|
||||
_owner = owner;
|
||||
_entity = entity;
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
{
|
||||
public class DropHandItemsOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly EntityUid _owner;
|
||||
|
||||
public DropHandItemsOperator(IEntity owner)
|
||||
public DropHandItemsOperator(EntityUid owner)
|
||||
{
|
||||
_owner = owner;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
{
|
||||
public sealed class EquipEntityOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _entity;
|
||||
public EquipEntityOperator(IEntity owner, IEntity entity)
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _entity;
|
||||
public EquipEntityOperator(EntityUid owner, EntityUid entity)
|
||||
{
|
||||
_owner = owner;
|
||||
_entity = entity;
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
/// </summary>
|
||||
public class InteractWithEntityOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _useTarget;
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _useTarget;
|
||||
|
||||
public InteractWithEntityOperator(IEntity owner, IEntity useTarget)
|
||||
public InteractWithEntityOperator(EntityUid owner, EntityUid useTarget)
|
||||
{
|
||||
_owner = owner;
|
||||
_useTarget = useTarget;
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
/// </summary>
|
||||
public sealed class OpenStorageOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _target;
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
|
||||
public OpenStorageOperator(IEntity owner, IEntity target)
|
||||
public OpenStorageOperator(EntityUid owner, EntityUid target)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
public class PickupEntityOperator : AiOperator
|
||||
{
|
||||
// Input variables
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _target;
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
|
||||
public PickupEntityOperator(IEntity owner, IEntity target)
|
||||
public PickupEntityOperator(EntityUid owner, EntityUid target)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace Content.Server.AI.Operators.Inventory
|
||||
/// </summary>
|
||||
public class UseItemInInventoryOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _target;
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
|
||||
public UseItemInInventoryOperator(IEntity owner, IEntity target)
|
||||
public UseItemInInventoryOperator(EntityUid owner, EntityUid target)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
|
||||
@@ -8,9 +8,9 @@ namespace Content.Server.AI.Operators.Movement
|
||||
public sealed class MoveToEntityOperator : AiOperator
|
||||
{
|
||||
// TODO: This and steering need to support InRangeUnobstructed now
|
||||
private readonly IEntity _owner;
|
||||
private readonly EntityUid _owner;
|
||||
private EntityTargetSteeringRequest? _request;
|
||||
private readonly IEntity _target;
|
||||
private readonly EntityUid _target;
|
||||
// For now we'll just get as close as we can because we're not doing LOS checks to be able to pick up at the max interaction range
|
||||
public float ArrivalDistance { get; }
|
||||
public float PathfindingProximity { get; }
|
||||
@@ -18,8 +18,8 @@ namespace Content.Server.AI.Operators.Movement
|
||||
private readonly bool _requiresInRangeUnobstructed;
|
||||
|
||||
public MoveToEntityOperator(
|
||||
IEntity owner,
|
||||
IEntity target,
|
||||
EntityUid owner,
|
||||
EntityUid target,
|
||||
float arrivalDistance = 1.0f,
|
||||
float pathfindingProximity = 1.5f,
|
||||
bool requiresInRangeUnobstructed = false)
|
||||
|
||||
@@ -8,12 +8,12 @@ namespace Content.Server.AI.Operators.Movement
|
||||
{
|
||||
public sealed class MoveToGridOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly EntityUid _owner;
|
||||
private GridTargetSteeringRequest? _request;
|
||||
private readonly EntityCoordinates _target;
|
||||
public float DesiredRange { get; set; }
|
||||
|
||||
public MoveToGridOperator(IEntity owner, EntityCoordinates target, float desiredRange = 1.5f)
|
||||
public MoveToGridOperator(EntityUid owner, EntityCoordinates target, float desiredRange = 1.5f)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
|
||||
@@ -11,11 +11,11 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
{
|
||||
public class UseDrinkInInventoryOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _target;
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
private float _interactionCooldown;
|
||||
|
||||
public UseDrinkInInventoryOperator(IEntity owner, IEntity target)
|
||||
public UseDrinkInInventoryOperator(EntityUid owner, EntityUid target)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
@@ -29,10 +29,12 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
return Outcome.Continuing;
|
||||
}
|
||||
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
// TODO: Also have this check storage a la backpack etc.
|
||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(_target) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_target).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(_owner, out HandsComponent? handsComponent) ||
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(_target, out ItemComponent? itemComponent))
|
||||
if ((!entities.EntityExists(_target) ? EntityLifeStage.Deleted : entities.GetComponent<MetaDataComponent>(_target).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
||||
!entities.TryGetComponent(_owner, out HandsComponent? handsComponent) ||
|
||||
!entities.TryGetComponent(_target, out ItemComponent? itemComponent))
|
||||
{
|
||||
return Outcome.Failed;
|
||||
}
|
||||
@@ -43,7 +45,7 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
{
|
||||
if (handsComponent.GetItem(slot) != itemComponent) continue;
|
||||
handsComponent.ActiveHand = slot;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(_target, out drinkComponent))
|
||||
if (!entities.TryGetComponent(_target, out drinkComponent))
|
||||
{
|
||||
return Outcome.Failed;
|
||||
}
|
||||
@@ -59,7 +61,7 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
}
|
||||
|
||||
if (drinkComponent.Deleted || EntitySystem.Get<DrinkSystem>().IsEmpty(drinkComponent.Owner, drinkComponent)
|
||||
|| IoCManager.Resolve<IEntityManager>().TryGetComponent(_owner, out ThirstComponent? thirstComponent) &&
|
||||
|| entities.TryGetComponent(_owner, out ThirstComponent? thirstComponent) &&
|
||||
thirstComponent.CurrentThirst >= thirstComponent.ThirstThresholds[ThirstThreshold.Okay])
|
||||
{
|
||||
return Outcome.Success;
|
||||
|
||||
@@ -10,11 +10,11 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
{
|
||||
public class UseFoodInInventoryOperator : AiOperator
|
||||
{
|
||||
private readonly IEntity _owner;
|
||||
private readonly IEntity _target;
|
||||
private readonly EntityUid _owner;
|
||||
private readonly EntityUid _target;
|
||||
private float _interactionCooldown;
|
||||
|
||||
public UseFoodInInventoryOperator(IEntity owner, IEntity target)
|
||||
public UseFoodInInventoryOperator(EntityUid owner, EntityUid target)
|
||||
{
|
||||
_owner = owner;
|
||||
_target = target;
|
||||
@@ -28,10 +28,12 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
return Outcome.Continuing;
|
||||
}
|
||||
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
// TODO: Also have this check storage a la backpack etc.
|
||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(_target) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_target).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(_owner, out HandsComponent? handsComponent) ||
|
||||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(_target, out ItemComponent? itemComponent))
|
||||
if ((!entities.EntityExists(_target) ? EntityLifeStage.Deleted : entities.GetComponent<MetaDataComponent>(_target).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
||||
!entities.TryGetComponent(_owner, out HandsComponent? handsComponent) ||
|
||||
!entities.TryGetComponent(_target, out ItemComponent? itemComponent))
|
||||
{
|
||||
return Outcome.Failed;
|
||||
}
|
||||
@@ -42,7 +44,7 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
{
|
||||
if (handsComponent.GetItem(slot) != itemComponent) continue;
|
||||
handsComponent.ActiveHand = slot;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(_target, out foodComponent))
|
||||
if (!entities.TryGetComponent(_target, out foodComponent))
|
||||
{
|
||||
return Outcome.Failed;
|
||||
}
|
||||
@@ -57,9 +59,9 @@ namespace Content.Server.AI.Operators.Nutrition
|
||||
return Outcome.Failed;
|
||||
}
|
||||
|
||||
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(_target) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_target).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
||||
if ((!entities.EntityExists(_target) ? EntityLifeStage.Deleted : entities.GetComponent<MetaDataComponent>(_target).EntityLifeStage) >= EntityLifeStage.Deleted ||
|
||||
foodComponent.UsesRemaining == 0 ||
|
||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(_owner, out HungerComponent? hungerComponent) &&
|
||||
entities.TryGetComponent(_owner, out HungerComponent? hungerComponent) &&
|
||||
hungerComponent.CurrentHunger >= hungerComponent.HungerThresholds[HungerThreshold.Okay])
|
||||
{
|
||||
return Outcome.Success;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.AI.Operators.Sequences
|
||||
{
|
||||
public class GoPickupEntitySequence : SequenceOperator
|
||||
{
|
||||
public GoPickupEntitySequence(IEntity owner, IEntity target)
|
||||
public GoPickupEntitySequence(EntityUid owner, EntityUid target)
|
||||
{
|
||||
Sequence = new Queue<AiOperator>(new AiOperator[]
|
||||
{
|
||||
@@ -17,4 +17,4 @@ namespace Content.Server.AI.Operators.Sequences
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user