GameLoop/MapResource.cs

Resource class representing a playable map asset. Defines metadata used in the lobby and map selector such as Title, Description, Thumbnail, Scene, game Mode, Hidden flag, and player count limits.

namespace Machines.Resources;

/// <summary>
/// Game mode type determining which lobby pool this map appears in.
/// </summary>
public enum GameModeType
{
	Race
}

/// <summary>
/// A playable map for the game
/// </summary>
[AssetType( Name = "Map", Extension = "mmap" )]
public sealed class MapResource : GameResource
{
	/// <summary>
	/// Display name on the lobby map card.
	/// </summary>
	public string Title { get; set; } = "Untitled";

	/// <summary>
	/// Short flavour text shown on the map card.
	/// </summary>
	public string Description { get; set; } = "";

	/// <summary>
	/// Thumbnail shown on the map card.
	/// </summary>
	public Texture Thumbnail { get; set; }

	/// <summary>
	/// Which game mode pool this map belongs to.
	/// </summary>
	public GameModeType Mode { get; set; } = GameModeType.Race;

	/// <summary>
	/// Scene to load when this map is launched.
	/// </summary>
	public SceneFile Scene { get; set; }

	/// <summary>
	/// Excludes this map from the selector pool in published builds (still visible in editor).
	/// </summary>
	public bool Hidden { get; set; } = false;

	/// <summary>
	/// Minimum total players required to start.
	/// </summary>
	public int MinPlayers { get; set; } = 1;

	/// <summary>
	/// Maximum total players this map supports.
	/// </summary>
	public int MaxPlayers { get; set; } = 4;
}