NpcFactionPrototype.cs 827 B

1234567891011121314151617181920212223242526272829303132
  1. using Robust.Shared.Prototypes;
  2. namespace Content.Shared.NPC.Prototypes;
  3. /// <summary>
  4. /// Contains data about this faction's relations with other factions.
  5. /// </summary>
  6. [Prototype]
  7. public sealed partial class NpcFactionPrototype : IPrototype
  8. {
  9. [ViewVariables]
  10. [IdDataField]
  11. public string ID { get; private set; } = default!;
  12. [DataField]
  13. public List<ProtoId<NpcFactionPrototype>> Friendly = new();
  14. [DataField]
  15. public List<ProtoId<NpcFactionPrototype>> Hostile = new();
  16. }
  17. /// <summary>
  18. /// Cached data for the faction prototype. Is modified at runtime, whereas the prototype is not.
  19. /// </summary>
  20. public record struct FactionData
  21. {
  22. [ViewVariables]
  23. public HashSet<ProtoId<NpcFactionPrototype>> Friendly;
  24. [ViewVariables]
  25. public HashSet<ProtoId<NpcFactionPrototype>> Hostile;
  26. }