NpcFactionMemberComponent.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Content.Shared.NPC.Prototypes;
  2. using Content.Shared.NPC.Systems;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Prototypes;
  5. namespace Content.Shared.NPC.Components;
  6. [RegisterComponent, NetworkedComponent, Access(typeof(NpcFactionSystem))]
  7. public sealed partial class NpcFactionMemberComponent : Component
  8. {
  9. /// <summary>
  10. /// Factions this entity is a part of.
  11. /// </summary>
  12. [DataField]
  13. public HashSet<ProtoId<NpcFactionPrototype>> Factions = new();
  14. /// <summary>
  15. /// Cached friendly factions.
  16. /// </summary>
  17. [ViewVariables]
  18. public readonly HashSet<ProtoId<NpcFactionPrototype>> FriendlyFactions = new();
  19. /// <summary>
  20. /// Cached hostile factions.
  21. /// </summary>
  22. [ViewVariables]
  23. public readonly HashSet<ProtoId<NpcFactionPrototype>> HostileFactions = new();
  24. /// <summary>
  25. /// Used to add friendly factions in prototypes.
  26. /// </summary>
  27. [DataField, ViewVariables]
  28. public HashSet<ProtoId<NpcFactionPrototype>>? AddFriendlyFactions;
  29. /// <summary>
  30. /// Used to add hostile factions in prototypes.
  31. /// </summary>
  32. [DataField, ViewVariables]
  33. public HashSet<ProtoId<NpcFactionPrototype>>? AddHostileFactions;
  34. }