IGameMapManager.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. namespace Content.Server.Maps;
  2. /// <summary>
  3. /// Manages which station map will be used for the next round.
  4. /// </summary>
  5. public interface IGameMapManager
  6. {
  7. void Initialize();
  8. /// <summary>
  9. /// Returns all maps eligible to be played right now.
  10. /// </summary>
  11. /// <returns>enumerator of map prototypes</returns>
  12. IEnumerable<GameMapPrototype> CurrentlyEligibleMaps();
  13. /// <summary>
  14. /// Returns all maps that can be voted for.
  15. /// </summary>
  16. /// <returns>enumerator of map prototypes</returns>
  17. IEnumerable<GameMapPrototype> AllVotableMaps();
  18. /// <summary>
  19. /// Returns all maps.
  20. /// </summary>
  21. /// <returns>enumerator of map prototypes</returns>
  22. IEnumerable<GameMapPrototype> AllMaps();
  23. /// <summary>
  24. /// Gets the currently selected map
  25. /// </summary>
  26. /// <returns>selected map</returns>
  27. GameMapPrototype? GetSelectedMap();
  28. /// <summary>
  29. /// Clears the selected map, if any
  30. /// </summary>
  31. void ClearSelectedMap();
  32. /// <summary>
  33. /// Attempts to select the given map, checking eligibility criteria
  34. /// </summary>
  35. /// <param name="gameMap">map prototype</param>
  36. /// <returns>success or failure</returns>
  37. bool TrySelectMapIfEligible(string gameMap);
  38. /// <summary>
  39. /// Select the given map regardless of eligibility
  40. /// </summary>
  41. /// <param name="gameMap">map prototype</param>
  42. /// <returns>success or failure</returns>
  43. void SelectMap(string gameMap);
  44. /// <summary>
  45. /// Selects a random map eligible map
  46. /// </summary>
  47. void SelectMapRandom();
  48. /// <summary>
  49. /// Selects the map at the front of the rotation queue
  50. /// </summary>
  51. /// <returns>selected map</returns>
  52. void SelectMapFromRotationQueue(bool markAsPlayed = false);
  53. /// <summary>
  54. /// Selects the map by following rules set in the config
  55. /// </summary>
  56. public void SelectMapByConfigRules();
  57. /// <summary>
  58. /// Checks if the given map exists
  59. /// </summary>
  60. /// <param name="gameMap">name of the map</param>
  61. /// <returns>existence</returns>
  62. bool CheckMapExists(string gameMap);
  63. }