Files
tbd-station-14/Content.Server/Maps/IGameMapManager.cs
Moony 3721b3303b Adds support for a map rotation system. (#7162)
* Adds support for a map rotation system.
It is now the default way of selecting a map, map votes have been disabled.

* whoops

* Randomize the map it starts off with, too.
(it'd pick bagel every time otherwise)

* Address review

* remove knight from rotation due to it being an unmaintained map.

* minor cleanup
2022-03-17 13:59:53 -05:00

70 lines
2.1 KiB
C#

using System.Collections.Generic;
namespace Content.Server.Maps;
/// <summary>
/// Manages which station map will be used for the next round.
/// </summary>
public interface IGameMapManager
{
void Initialize();
/// <summary>
/// Returns all maps eligible to be played right now.
/// </summary>
/// <returns>enumerator of map prototypes</returns>
IEnumerable<GameMapPrototype> CurrentlyEligibleMaps();
/// <summary>
/// Returns all maps that can be voted for.
/// </summary>
/// <returns>enumerator of map prototypes</returns>
IEnumerable<GameMapPrototype> AllVotableMaps();
/// <summary>
/// Returns all maps.
/// </summary>
/// <returns>enumerator of map prototypes</returns>
IEnumerable<GameMapPrototype> AllMaps();
/// <summary>
/// Attempts to select the given map.
/// </summary>
/// <param name="gameMap">map prototype</param>
/// <returns>success or failure</returns>
bool TrySelectMap(string gameMap);
/// <summary>
/// Forces the given map, making sure the game map manager won't reselect if conditions are no longer met at round restart.
/// </summary>
/// <param name="gameMap">map prototype</param>
/// <returns>success or failure</returns>
void ForceSelectMap(string gameMap);
/// <summary>
/// Selects a random map.
/// </summary>
void SelectRandomMap();
/// <summary>
/// Gets the currently selected map, without double-checking if it can be used.
/// </summary>
/// <returns>selected map</returns>
GameMapPrototype GetSelectedMap();
/// <summary>
/// Gets the currently selected map, double-checking if it can be used.
/// </summary>
/// <returns>selected map</returns>
GameMapPrototype GetSelectedMapChecked(bool loud = false, bool markAsPlayed = false);
/// <summary>
/// Checks if the given map exists
/// </summary>
/// <param name="gameMap">name of the map</param>
/// <returns>existence</returns>
bool CheckMapExists(string gameMap);
public string GenerateMapName(GameMapPrototype gameMap);
}