Cleanup factions code (#11075)

Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
metalgearsloth
2022-09-15 04:45:02 +10:00
committed by GitHub
parent 356a6b8d2e
commit 8871c445b8
34 changed files with 311 additions and 287 deletions

View File

@@ -0,0 +1,29 @@
using Content.Server.NPC.Systems;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.NPC.Components
{
[RegisterComponent]
[Access(typeof(FactionSystem))]
public sealed class FactionComponent : Component
{
/// <summary>
/// Factions this entity is a part of.
/// </summary>
[ViewVariables(VVAccess.ReadWrite),
DataField("factions", customTypeSerializer:typeof(PrototypeIdHashSetSerializer<FactionPrototype>))]
public HashSet<string> Factions = new();
/// <summary>
/// Cached friendly factions.
/// </summary>
[ViewVariables]
public readonly HashSet<string> FriendlyFactions = new();
/// <summary>
/// Cached hostile factions.
/// </summary>
[ViewVariables]
public readonly HashSet<string> HostileFactions = new();
}
}