mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
26 lines
618 B
C#
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; }
|
|
}
|
|
}
|
|
}
|