TheAirline.Models.Airports.Airport.GetGatePrice C# (CSharp) Method

GetGatePrice() public method

public GetGatePrice ( ) : long
return long
        public long GetGatePrice()
        {
            long sizeValue = 100 + 102*((int) Profile.Size + 1);
            return Convert.ToInt64(GeneralHelpers.GetInflationPrice(sizeValue));
        }

Usage Example

        //returns if an airline has enough free slots at an airport
        //returns the yearly payment for a number of gates
        public static double GetYearlyContractPayment(
            Airport airport,
            AirportContract.ContractType type,
            int gates,
            int length)
        {
            double basePrice = 0;

            if (type == AirportContract.ContractType.Full)
            {
                basePrice = airport.GetGatePrice()*12;
            }

            if (type == AirportContract.ContractType.LowService)
            {
                basePrice = airport.GetGatePrice()*13;
            }

            if (type == AirportContract.ContractType.MediumService)
            {
                basePrice = airport.GetGatePrice()*17;
            }

            if (type == AirportContract.ContractType.FullService)
            {
                basePrice = airport.GetGatePrice()*20;
            }

            double lengthFactor = 100 - length;

            return gates*(basePrice*(lengthFactor/100));
        }