Predict two-way levers (#25043)

* Predict two-way levers

Annoys me the rare occasions I touch cargo. Doesn't predict the signal but at least the lever responds immediately.

* space

* a
This commit is contained in:
metalgearsloth
2024-02-11 14:19:45 +11:00
committed by GitHub
parent 8e59b4f505
commit 05a2ddff1c
35 changed files with 114 additions and 68 deletions

View File

@@ -1,26 +0,0 @@
using Robust.Shared.Utility;
using System.Diagnostics.CodeAnalysis;
namespace Content.Server.DeviceNetwork
{
public sealed class NetworkPayload : Dictionary<string, object?>
{
/// <summary>
/// Tries to get a value from the payload and checks if that value is of type T.
/// </summary>
/// <typeparam name="T">The type that should be casted to</typeparam>
/// <returns>Whether the value was present in the payload and of the required type</returns>
public bool TryGetValue<T>(string key, [NotNullWhen(true)] out T? value)
{
if (this.TryCastValue(key, out T? result))
{
value = result;
return true;
}
value = default;
return false;
}
}
}

View File

@@ -1,5 +1,6 @@
using Content.Server.DeviceNetwork.Components;
using Content.Server.DeviceNetwork.Components.Devices;
using Content.Shared.DeviceNetwork;
using Content.Shared.Interaction;
namespace Content.Server.DeviceNetwork.Systems.Devices