Files
basic-computer-games/84 Super Star Trek/csharp/Systems/Subsystem.cs
2021-03-01 22:53:22 +11:00

26 lines
618 B
C#

using SuperStarTrek.Space;
namespace SuperStarTrek.Systems
{
internal abstract class Subsystem
{
protected Subsystem(string name, Command command)
{
Name = name;
Command = command;
Condition = 0;
}
public string Name { get; }
public double Condition { get; private set; }
public bool IsDamaged => Condition < 0;
public Command Command { get; }
public abstract void ExecuteCommand(Quadrant quadrant);
public void Repair()
{
if (Condition < 0) { Condition = 0; }
}
}
}