Fix cleanbots (#16922)

This commit is contained in:
metalgearsloth
2023-05-29 16:53:28 +10:00
committed by GitHub
parent c3e369cbdd
commit f308a1b31e
7 changed files with 75 additions and 125 deletions

View File

@@ -4,6 +4,7 @@ using Content.Server.Interaction;
using Content.Shared.Access.Systems;
using Content.Shared.ActionBlocker;
using Content.Shared.Interaction;
using JetBrains.Annotations;
using Robust.Shared.Utility;
namespace Content.Server.NPC;
@@ -60,6 +61,7 @@ public sealed class NPCBlackboard : IEnumerable<KeyValuePair<string, object>>
return dict;
}
[Pure]
public bool ContainsKey(string key)
{
return _blackboard.ContainsKey(key);
@@ -68,6 +70,7 @@ public sealed class NPCBlackboard : IEnumerable<KeyValuePair<string, object>>
/// <summary>
/// Get the blackboard data for a particular key.
/// </summary>
[Pure]
public T GetValue<T>(string key)
{
return (T) _blackboard[key];
@@ -76,6 +79,7 @@ public sealed class NPCBlackboard : IEnumerable<KeyValuePair<string, object>>
/// <summary>
/// Tries to get the blackboard data for a particular key. Returns default if not found
/// </summary>
[Pure]
public T? GetValueOrDefault<T>(string key, IEntityManager entManager)
{
if (_blackboard.TryGetValue(key, out var value))