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