本文整理汇总了C#中Sim.CanUseVehicleRightNow方法的典型用法代码示例。如果您正苦于以下问题:C# Sim.CanUseVehicleRightNow方法的具体用法?C# Sim.CanUseVehicleRightNow怎么用?C# Sim.CanUseVehicleRightNow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sim
的用法示例。
在下文中一共展示了Sim.CanUseVehicleRightNow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOwnedAndUsableVehicle
public static Vehicle GetOwnedAndUsableVehicle(Sim ths, Lot lot, bool bAddPending, bool bAllowBikes, bool bIgnoreCanDrive, bool allowUFO)
{
if (ths.IsPet)
{
return null;
}
Vehicle vehicleForCurrentInteraction = ths.GetVehicleForCurrentInteraction();
if (vehicleForCurrentInteraction != null)
{
return vehicleForCurrentInteraction;
}
/*
if (GameUtils.IsInstalled(ProductVersion.EP2))
{
ActiveFireFighter occupation = ths.Occupation as ActiveFireFighter;
if (occupation != null)
{
Car vehicle = occupation.GetVehicle(bAddPending);
if (vehicle != null)
{
return vehicle;
}
}
}
*/
Vehicle reservedVehicle = ths.GetReservedVehicle();
if ((reservedVehicle != null) && (bAllowBikes || (!(reservedVehicle is Bicycle) && !(reservedVehicle is MagicBroom))))
{
IOwnableVehicle vehicle3 = reservedVehicle as IOwnableVehicle;
if (vehicle3 == null)
{
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)
//.........这里部分代码省略.........