Cleans up warnings in disposals (#17419)

This commit is contained in:
TemporalOroboros
2023-06-21 07:31:19 -07:00
committed by GitHub
parent f14f09cc90
commit 9849737e5a
17 changed files with 396 additions and 387 deletions

View File

@@ -4,7 +4,7 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Disposal;
[Serializable, NetSerializable]
public sealed class MailingUnitBoundUserInterfaceState: BoundUserInterfaceState, IEquatable<MailingUnitBoundUserInterfaceState>
public sealed class MailingUnitBoundUserInterfaceState : BoundUserInterfaceState, IEquatable<MailingUnitBoundUserInterfaceState>
{
public string? Target;
public List<string> TargetList;
@@ -21,11 +21,25 @@ public sealed class MailingUnitBoundUserInterfaceState: BoundUserInterfaceState,
public bool Equals(MailingUnitBoundUserInterfaceState? other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
if (other is null)
return false;
if (ReferenceEquals(this, other))
return true;
return DisposalState.Equals(other.DisposalState)
&& Target == other.Target
&& TargetList.Equals(other.TargetList)
&& Tag == other.Tag;
}
public override bool Equals(object? other)
{
if (other is MailingUnitBoundUserInterfaceState otherState)
return Equals(otherState);
return false;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}

View File

@@ -14,10 +14,10 @@ public enum MailingUnitUiKey : byte
[Serializable, NetSerializable]
public sealed class TargetSelectedMessage : BoundUserInterfaceMessage
{
public readonly string? target;
public readonly string? Target;
public TargetSelectedMessage(string? target)
{
this.target = target;
Target = target;
}
}

View File

@@ -63,7 +63,7 @@ namespace Content.Shared.Disposal
if (args.Handled)
return;
args.CanDrop = CanInsert(component, args.Dragged);
args.CanDrop = CanInsert(uid, component, args.Dragged);
args.Handled = true;
}
@@ -73,9 +73,9 @@ namespace Content.Shared.Disposal
args.Handled = true;
}
public virtual bool CanInsert(SharedDisposalUnitComponent component, EntityUid entity)
public virtual bool CanInsert(EntityUid uid, SharedDisposalUnitComponent component, EntityUid entity)
{
if (!EntityManager.GetComponent<TransformComponent>(component.Owner).Anchored)
if (!EntityManager.GetComponent<TransformComponent>(uid).Anchored)
return false;
// TODO: Probably just need a disposable tag.