sa/Stars Assistant/Services/Game.cs

34 lines
1.1 KiB
C#

namespace StarsAssistant.Services;
public class Game
{
/// <summary>
/// The base path in which all game files reside.
/// </summary>
public required string GamePath { get; set; }
/// <summary>
/// The base name without extensions of your game, inside the GamePath folder.
/// All dependant files are resolved using this name.
/// </summary>
public required string BaseName { get; set; }
/// <summary>
/// Combine into the DatabaseName
/// </summary>
public string DatabaseFileName => Path.Combine(GamePath, $"{BaseName}.sqlite");
/// <summary>
/// Search for Planet files using this pattern, will give you all pxx files.
/// </summary>
public string PlanetFileSearchPattern => $"{BaseName}.p*";
/// <summary>
/// Get the name of a planet file for a given race.
/// </summary>
/// <param name="r">The race to load.</param>
/// <returns>Fully qualified file path.</returns>
public string PlanetFileForRace (Model.Race r) => Path.Combine(GamePath, $"{BaseName}.p{r.PlayerFileId}");
}