Files
basic-computer-games/84 Super Star Trek/csharp/Commands/CommandResult.cs
2021-03-07 18:27:55 +11:00

24 lines
593 B
C#

namespace SuperStarTrek.Commands
{
internal class CommandResult
{
public static readonly CommandResult Ok = new(false);
public static readonly CommandResult GameOver = new(true);
private CommandResult(bool isGameOver)
{
IsGameOver = isGameOver;
}
private CommandResult(float timeElapsed)
{
TimeElapsed = timeElapsed;
}
public bool IsGameOver { get; }
public float TimeElapsed { get; }
public static CommandResult Elapsed(float timeElapsed) => new(timeElapsed);
}
}