Fix energy usage by warp engines.

This commit is contained in:
Andrew Cooper
2021-03-21 13:55:55 +11:00
parent e3f5376248
commit 5418068462
2 changed files with 8 additions and 1 deletions

View File

@@ -179,6 +179,13 @@ namespace SuperStarTrek.Objects
_quadrant.SetEnterpriseSector(sector);
SectorCoordinates = sector;
TotalEnergy -= distance + 10;
if (Energy < 0)
{
_output.WriteLine("Shield Control supplies energy to complete the maneuver.");
ShieldControl.ShieldEnergy = Math.Max(0, TotalEnergy);
}
return GetTimeElapsed(quadrant, warpFactor);
}

View File

@@ -18,7 +18,7 @@ namespace SuperStarTrek.Systems
_input = input;
}
public float ShieldEnergy { get; private set; }
public float ShieldEnergy { get; set; }
protected override bool CanExecuteCommand() => IsOperational("{name} inoperable");