当前位置: 首页>>代码示例>>C#>>正文


C# Sim.GetMostExpensiveUsableParkedVehicle方法代码示例

本文整理汇总了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;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:101,代码来源:SimEx.cs


注:本文中的Sim.GetMostExpensiveUsableParkedVehicle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。