本文整理汇总了C#中TheAirline.Model.AirlineModel.Airline.getAirlineValue方法的典型用法代码示例。如果您正苦于以下问题:C# Airline.getAirlineValue方法的具体用法?C# Airline.getAirlineValue怎么用?C# Airline.getAirlineValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TheAirline.Model.AirlineModel.Airline
的用法示例。
在下文中一共展示了Airline.getAirlineValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPricePerAirlineShare
//returns the current price per share for an airline
public static double GetPricePerAirlineShare(Airline airline)
{
Random rnd = new Random();
double price = 0;
Airline.AirlineValue value = airline.getAirlineValue();
switch (value)
{
case Airline.AirlineValue.Low:
price = 15 + (rnd.NextDouble() * 10);
break;
case Airline.AirlineValue.Very_low:
price = 5 + (rnd.NextDouble() * 10);
break;
case Airline.AirlineValue.Normal:
price = 25 + (rnd.NextDouble() * 10);
break;
case Airline.AirlineValue.High:
price = 40 + (rnd.NextDouble() * 10);
break;
case Airline.AirlineValue.Very_high:
price = 55 + (rnd.NextDouble() * 10);
break;
}
return GeneralHelpers.GetInflationPrice(price);
}
示例2: CanCreateHub
//returns if an airline can create a hub at an airport
public static Boolean CanCreateHub(Airline airline, Airport airport, HubType type)
{
Boolean airlineHub = airport.getHubs().Exists(h => h.Airline == airline);
int airlineValue = (int)airline.getAirlineValue() + 1;
int totalAirlineHubs = airline.getHubs().Count;// 'Airports.GetAllActiveAirports().Sum(a => a.Hubs.Count(h => h.Airline == airline));
double airlineGatesPercent = Convert.ToDouble(airport.Terminals.getNumberOfGates(airline)) / Convert.ToDouble(airport.Terminals.getNumberOfGates()) * 100;
switch (type.Type)
{
case HubType.TypeOfHub.Focus_city:
return !airlineHub && airline.Money > AirportHelpers.GetHubPrice(airport, type);
case HubType.TypeOfHub.Regional_hub:
return !airlineHub && airline.Money > AirportHelpers.GetHubPrice(airport, type) && (airport.Profile.Size == GeneralHelpers.Size.Large || airport.Profile.Size == GeneralHelpers.Size.Medium) && airport.getHubs().Count < 7;
case HubType.TypeOfHub.Fortress_hub:
return !airlineHub && airline.Money > AirportHelpers.GetHubPrice(airport, type) && (airport.Profile.Size > GeneralHelpers.Size.Medium) && airlineGatesPercent > 70 && (totalAirlineHubs < airlineValue);
case HubType.TypeOfHub.Hub:
return !airlineHub && airline.Money > AirportHelpers.GetHubPrice(airport, type) && (!airlineHub) && (airlineGatesPercent > 20) && (totalAirlineHubs < airlineValue) && (airport.getHubs(HubType.TypeOfHub.Hub).Count < (int)airport.Profile.Size);
}
return false;
}