Refuel Enterprise at starbase

This commit is contained in:
Andrew Cooper
2021-03-21 13:12:44 +11:00
parent 5e6aae3c19
commit e3f5376248
4 changed files with 13 additions and 0 deletions

View File

@@ -75,6 +75,8 @@ namespace SuperStarTrek.Objects
return _commandExecutors[command].ExecuteCommand(_quadrant);
}
public void Refuel() => TotalEnergy = _maxEnergy;
internal bool Recognises(string command)
{
throw new NotImplementedException();

View File

@@ -60,5 +60,7 @@ namespace SuperStarTrek.Systems
return quadrant.KlingonsFireOnEnterprise();
}
internal void ReplenishTorpedoes() => TorpedoCount = _tubeCount;
}
}

View File

@@ -51,5 +51,7 @@ namespace SuperStarTrek.Systems
}
internal void AbsorbHit(int hitStrength) => ShieldEnergy -= hitStrength;
internal void DropShields() => ShieldEnergy = 0;
}
}

View File

@@ -32,6 +32,13 @@ namespace SuperStarTrek.Systems
_enterprise.VaryConditionOfRandomSystem();
var timeElapsed = _enterprise.Move(course, warpFactor, distanceToMove);
if (_enterprise.IsDocked)
{
_enterprise.ShieldControl.DropShields();
_enterprise.Refuel();
_enterprise.PhotonTubes.ReplenishTorpedoes();
}
return CommandResult.Elapsed(timeElapsed);
}