diff --git a/airpower/aircraft.py b/airpower/aircraft.py index 398b1668..f9b62cf9 100644 --- a/airpower/aircraft.py +++ b/airpower/aircraft.py @@ -442,15 +442,15 @@ def startmove(self, flighttype, powerap, actions): if not isinstance(powerap, (int, float)) or powerap < 0 or powerap % 0.5 != 0: raise ValueError("invalid power AP %s" % powerap) # TODO: Don't assume CL. - powertable = self._aircrafttype.powertable("CL") + powerchart = self._aircrafttype.powerchart("CL") if powerap == 0: powersetting = "NOR" - elif powerap <= powertable["MIL"]: + elif powerap <= powerchart["MIL"]: powersetting = "MIL" - elif "AB" in powertable and powerap <= powertable["AB"]: + elif "AB" in powerchart and powerap <= powerchart["AB"]: powersetting = "AB" else: - raise ValueError("requested power %s exceeds aircraft capability.") + raise ValueError("requested power %s APs exceeds aircraft capability.") self._restore(apturn.turn() - 1) @@ -548,7 +548,8 @@ def _endmove(self): turnap = 0.0 else: # TODO: Don't assume CL. - turnap = -self._aircrafttype.turndragtable("CL")[self._maxturnrate] + # TODO: Calculate this at the moment of the maximum turn, since it depends on the configuration. + turnap = -self._aircrafttype.turndragchart("CL")[self._maxturnrate] self._report("power APs = %+.1f." % self._powerap) self._report("turn APs = %+.1f and %+.1f." % (turnap, self._sustainedturnap)) diff --git a/airpower/aircrafttype.py b/airpower/aircrafttype.py index 71a7c672..6be41bac 100644 --- a/airpower/aircrafttype.py +++ b/airpower/aircrafttype.py @@ -3,7 +3,7 @@ class aircrafttype: def __init__(self, name): self._name = name - def powertable(self, configuration): + def powerchart(self, configuration): if self._name == "F-80C": return { "CL" : { "MIL": 1.0, }, @@ -17,7 +17,7 @@ def powertable(self, configuration): "DT" : { "MIL": 0.5, }, }[configuration] - def turndragtable(self, configuration): + def turndragchart(self, configuration): if self._name == "F-80C": return { "CL" : { "TT": 0.0, "HT": 1.0, "BT": 1.0, },