GamePresetPrototype.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Content.Server.Maps;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  5. namespace Content.Server.GameTicking.Presets
  6. {
  7. /// <summary>
  8. /// A round-start setup preset, such as which antagonists to spawn.
  9. /// </summary>
  10. [Prototype]
  11. public sealed partial class GamePresetPrototype : IPrototype
  12. {
  13. [IdDataField]
  14. public string ID { get; private set; } = default!;
  15. [DataField("alias")]
  16. public string[] Alias = Array.Empty<string>();
  17. [DataField("name")]
  18. public string ModeTitle = "????";
  19. [DataField("description")]
  20. public string Description = string.Empty;
  21. [DataField("showInVote")]
  22. public bool ShowInVote;
  23. [DataField("minPlayers")]
  24. public int? MinPlayers;
  25. [DataField("maxPlayers")]
  26. public int? MaxPlayers;
  27. [DataField("rules", customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
  28. public IReadOnlyList<string> Rules { get; private set; } = Array.Empty<string>();
  29. /// <summary>
  30. /// If specified, the gamemode will only be run with these maps.
  31. /// If none are elligible, the global fallback will be used.
  32. /// </summary>
  33. [DataField("supportedMaps", customTypeSerializer: typeof(PrototypeIdSerializer<GameMapPoolPrototype>))]
  34. public string? MapPool;
  35. }
  36. }