Ignore:
Timestamp:
07/26/16 17:27:46 (8 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The booked flight is passed to the aircraft created.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r797 r798  
    9898    """Base class for aircraft."""
    9999    @staticmethod
    100     def create(flight):
     100    def create(flight, bookedFlight):
    101101        """Create an aircraft instance for the type in the given flight."""
    102         return _classes[flight.aircraftType](flight)
     102        acft = _classes[flight.aircraftType](flight)
     103        acft.setBookedFlight(bookedFlight)
     104        return acft
    103105
    104106    def __init__(self, flight, minLandingFuel = None,
     
    279281        This default implementation returns DERATE_NONE."""
    280282        return DERATE_NONE
     283
     284    def setBookedFlight(self, bookedFlight):
     285        """Update the aircraft based on the booked flight data (e.g. tail number).
     286
     287        This default implementation does nothing."""
    281288
    282289    def getDerateLine(self, value):
Note: See TracChangeset for help on using the changeset viewer.