SpawnPointComponent.cs 914 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Content.Shared.NPC.Prototypes;
  2. using Content.Shared.Roles;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Server.Spawners.Components;
  5. [RegisterComponent]
  6. public sealed partial class SpawnPointComponent : Component, ISpawnPoint
  7. {
  8. [DataField("job_id")]
  9. public ProtoId<JobPrototype>? Job;
  10. /// <summary>
  11. /// The faction that this spawn point applies to
  12. /// Remember to set SpawnType to Faction!
  13. /// </summary>
  14. [DataField("faction")]
  15. public ProtoId<NpcFactionPrototype>? Faction;
  16. /// <summary>
  17. /// The type of spawn point
  18. /// </summary>
  19. [DataField("spawn_type"), ViewVariables(VVAccess.ReadWrite)]
  20. public SpawnPointType SpawnType { get; set; } = SpawnPointType.Unset;
  21. public override string ToString()
  22. {
  23. return $"{Job} {SpawnType}";
  24. }
  25. }
  26. public enum SpawnPointType
  27. {
  28. Unset = 0,
  29. LateJoin,
  30. Job,
  31. Observer,
  32. Faction,
  33. }