本文整理汇总了C#中Sim.GetMostExpensiveUsableParkedVehicle方法的典型用法代码示例。如果您正苦于以下问题:C# Sim.GetMostExpensiveUsableParkedVehicle方法的具体用法?C# Sim.GetMostExpensiveUsableParkedVehicle怎么用?C# Sim.GetMostExpensiveUsableParkedVehicle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sim
的用法示例。
在下文中一共展示了Sim.GetMostExpensiveUsableParkedVehicle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOwnedAndUsableVehicle
//.........这里部分代码省略.........
{
return reservedVehicle;
}
if (ths.CanUseVehicleRightNow(vehicle3, true, true))
{
if (bAddPending)
{
vehicle3.PendingUse = true;
}
return reservedVehicle;
}
}
/*
if (ths.OccupationAsPerformanceCareer != null)
{
Car car2 = ths.OccupationAsPerformanceCareer.GetCareerCar();
if (car2 != null)
{
return car2;
}
}
else if (ths.CareerManager.OccupationAsCareer != null)
{
FortuneTellerCareer career = ths.CareerManager.Occupation as FortuneTellerCareer;
if (((career != null) && (career.CurLevelBranchName == "ScamArtist")) && (career.Level >= FortuneTellerCareer.kLevelNeededForLimoRide))
{
Car car3 = GlobalFunctions.CreateObjectOutOfWorld("CarLimo") as Car;
car3.DestroyOnRelease = true;
return car3;
}
}
*/
IOwnableVehicle preferredVehicle = ths.GetPreferredVehicle();
if (ths.CanUseVehicleRightNow(preferredVehicle, true, bIgnoreCanDrive) && (bAllowBikes || (!(reservedVehicle is Bicycle) && !(reservedVehicle is MagicBroom))))
{
if (bAddPending)
{
preferredVehicle.PendingUse = true;
}
return (preferredVehicle as Vehicle);
}
if (bAllowBikes && ths.HasTrait(TraitNames.Rebellious))
{
IOwnableVehicle motorcycleIfAvailable = ths.GetMotorcycleIfAvailable(bAddPending, bIgnoreCanDrive);
if (motorcycleIfAvailable != null)
{
return (motorcycleIfAvailable as Vehicle);
}
}
if (bAllowBikes && ths.HasTrait(TraitNames.EnvironmentallyConscious))
{
IOwnableVehicle bikeIfAvailable = ths.GetBikeIfAvailable(bAddPending, bIgnoreCanDrive);
if (bikeIfAvailable != null)
{
return (bikeIfAvailable as Vehicle);
}
}
// Custom
List<IOwnableVehicle> vehicles = Inventories.QuickDuoFind<IOwnableVehicle, Vehicle>(ths.Inventory);
IOwnableVehicle vehicle = ths.GetBroomOrMostExpensiveUsableVehicle(vehicles, bAllowBikes, bAddPending, bIgnoreCanDrive, allowUFO, false);
if (vehicle != null)
{
return (vehicle as Vehicle);
}
vehicles.Clear();
vehicle = ths.GetMostExpensiveUsableParkedVehicle(lot, bAllowBikes, bAddPending, bIgnoreCanDrive, allowUFO);
if (vehicle != null)
{
return (vehicle as Vehicle);
}
if (lot != ths.LotHome)
{
vehicle = ths.GetMostExpensiveUsableParkedVehicle(ths.LotHome, bAllowBikes, bAddPending, bIgnoreCanDrive, allowUFO);
if (vehicle != null)
{
return (vehicle as Vehicle);
}
}
/*
Car careerCar = ths.GetCareerCar();
if (careerCar != null)
{
IOwnableVehicle vehicle8 = careerCar as IOwnableVehicle;
if (bAddPending && (vehicle8 != null))
{
vehicle8.PendingUse = true;
}
return careerCar;
}
*/
return null;
}