NanotrasenNameGenerator.cs 884 B

123456789101112131415161718192021222324
  1. using JetBrains.Annotations;
  2. using Robust.Shared.Random;
  3. namespace Content.Server.Maps.NameGenerators;
  4. [UsedImplicitly]
  5. public sealed partial class NanotrasenNameGenerator : StationNameGenerator
  6. {
  7. /// <summary>
  8. /// Where the map comes from. Should be a two or three letter code, for example "VG" for Packedstation.
  9. /// </summary>
  10. [DataField("prefixCreator")] public string PrefixCreator = default!;
  11. private string Prefix => "NT";
  12. private string[] SuffixCodes => new []{ "LV", "NX", "EV", "QT", "PR" };
  13. public override string FormatName(string input)
  14. {
  15. var random = IoCManager.Resolve<IRobustRandom>();
  16. // No way in hell am I writing custom format code just to add nice names. You can live with {0}
  17. return string.Format(input, $"{Prefix}{PrefixCreator}", $"{random.Pick(SuffixCodes)}-{random.Next(0, 999):D3}");
  18. }
  19. }