Fix a bunch of warnings (#9528)

This commit is contained in:
metalgearsloth
2022-07-09 09:07:47 +10:00
committed by GitHub
parent 9f80b7b68a
commit 4a393d4665
16 changed files with 65 additions and 82 deletions

View File

@@ -9,7 +9,7 @@ namespace Content.Shared.Alert;
/// falls back to the id.
/// </summary>
[Serializable, NetSerializable]
public struct AlertKey : ISerializationHooks, IPopulateDefaultValues
public struct AlertKey :IPopulateDefaultValues
{
public AlertType? AlertType { get; private set; }
public readonly AlertCategory? AlertCategory;
@@ -58,4 +58,4 @@ public struct AlertKey : ISerializationHooks, IPopulateDefaultValues
{
return new(null, category);
}
}
}

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Body.Components
{
[RegisterComponent]
public sealed class MechanismComponent : Component, ISerializationHooks
public sealed class MechanismComponent : Component
{
[Dependency] private readonly IEntityManager _entMan = default!;
private SharedBodyPartComponent? _part;

View File

@@ -2,6 +2,7 @@ using System.Linq;
using Content.Shared.DragDrop;
using Content.Shared.Interaction;
using Content.Shared.MobState.Components;
using Content.Shared.MobState.EntitySystems;
using JetBrains.Annotations;
using Robust.Shared.Containers;
using Robust.Shared.Map;
@@ -15,6 +16,7 @@ namespace Content.Shared.Examine
{
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] protected readonly SharedMobStateSystem MobStateSystem = default!;
public const float MaxRaycastRange = 100;
@@ -43,8 +45,8 @@ namespace Content.Shared.Examine
public bool IsInDetailsRange(EntityUid examiner, EntityUid entity)
{
// check if the mob is in ciritcal or dead
if (EntityManager.TryGetComponent(examiner, out MobStateComponent? mobState) && mobState.IsIncapacitated())
// check if the mob is in critical or dead
if (MobStateSystem.IsIncapacitated(examiner))
return false;
if (!_interactionSystem.InRangeUnobstructed(examiner, entity, ExamineDetailsRange))
@@ -94,9 +96,9 @@ namespace Content.Shared.Examine
{
if (Resolve(examiner, ref mobState, logMissing: false))
{
if (mobState.IsDead())
if (MobStateSystem.IsDead(examiner, mobState))
return DeadExamineRange;
else if (mobState.IsCritical())
else if (MobStateSystem.IsCritical(examiner, mobState))
return CritExamineRange;
}
return ExamineRange;

View File

@@ -37,7 +37,7 @@ namespace Content.Shared.Hands.Components
_blockingEntity = pullState.BlockingEntity;
// update hands GUI with new entity.
if (Owner.TryGetContainer(out var containter))
if (Owner.TryGetContainer(out _))
EntitySystem.Get<SharedItemSystem>().VisualsChanged(Owner);
}

View File

@@ -8,5 +8,5 @@ namespace Content.Shared.Shuttles.Events;
[Serializable, NetSerializable]
public sealed class AutodockRequestMessage : BoundUserInterfaceMessage
{
public EntityUid Entity;
public EntityUid DockEntity;
}

View File

@@ -8,5 +8,5 @@ namespace Content.Shared.Shuttles.Events;
[Serializable, NetSerializable]
public sealed class StopAutodockRequestMessage : BoundUserInterfaceMessage
{
public EntityUid Entity;
public EntityUid DockEntity;
}

View File

@@ -8,5 +8,5 @@ namespace Content.Shared.Shuttles.Events;
[Serializable, NetSerializable]
public sealed class UndockRequestMessage : BoundUserInterfaceMessage
{
public EntityUid Entity;
public EntityUid DockEntity;
}

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Shared.Stacks
{
[NetworkedComponent, Access(typeof(SharedStackSystem))]
public abstract class SharedStackComponent : Component, ISerializationHooks
public abstract class SharedStackComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("stackType", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<StackPrototype>))]

View File

@@ -34,7 +34,7 @@ namespace Content.Shared.Wires
}
[Serializable, NetSerializable]
public class WiresActionMessage : BoundUserInterfaceMessage
public sealed class WiresActionMessage : BoundUserInterfaceMessage
{
public readonly int Id;
public readonly WiresAction Action;
@@ -116,7 +116,7 @@ namespace Content.Shared.Wires
}
[Serializable, NetSerializable]
public class WiresBoundUserInterfaceState : BoundUserInterfaceState
public sealed class WiresBoundUserInterfaceState : BoundUserInterfaceState
{
public string BoardName { get; }
public string? SerialNumber { get; }
@@ -167,7 +167,7 @@ namespace Content.Shared.Wires
/// what wires there are on an entity.
/// </summary>
[Serializable, NetSerializable]
public class ClientWire
public sealed class ClientWire
{
/// <summary>
/// ID of this wire, which corresponds to