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


C# Lot.GetObjects方法代码示例

本文整理汇总了C#中Lot.GetObjects方法的典型用法代码示例。如果您正苦于以下问题:C# Lot.GetObjects方法的具体用法?C# Lot.GetObjects怎么用?C# Lot.GetObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lot的用法示例。


在下文中一共展示了Lot.GetObjects方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnExitBuildBuy

		public void OnExitBuildBuy(Lot lot)
		{
			foreach(ComboRabbitHole comboRH in lot.GetObjects<ComboRabbitHole>())
			{
				AddContainedRabbitHolesToLot (comboRH);
			}
		}
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:FixComboRabbitHoleMetaAds.cs

示例2: OnExitBuildBuy

 public void OnExitBuildBuy(Lot lot)
 {
     foreach (ISprinkler sprinkler in lot.GetObjects<ISprinkler>())
     {
         this.SetSprinklerAlarm(sprinkler);
     }
 }
开发者ID:GnatGoSplat,项目名称:NRaas,代码行数:7,代码来源:SprinklerEx.cs

示例3: OnExitBuildBuy

 public void OnExitBuildBuy(Lot lot)
 {
     foreach (ShowStage stage in lot.GetObjects<ShowStage>())
     {
         ShowStageEx.StoreChanges(stage, Overwatch.Log);
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:CleanupShowStage.cs

示例4: OnExitBuildBuy

 public void OnExitBuildBuy(Lot lot)
 {
     foreach (AncientPortal portal in lot.GetObjects<AncientPortal>())
     {
         if (portal.PortalComponent == null)
         {
             ObjectComponents.AddComponent<AncientPortalComponent>(portal, new object[0]);
         }
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:10,代码来源:AncientPortalRoutingHelper.cs

示例5: Run

        protected override OptionResult Run(Lot lot, Household me)
        {
            if (lot == null) return OptionResult.Failure;

            if (!ApplyAll)
            {
                string text = StringInputDialog.Show(Name, Common.Localize("DepreciateHouse:Prompt"), "0", 256, StringInputDialog.Validation.None);
                if ((text == null) || (text == "")) return OptionResult.Failure;

                mValue = 0;
                if (!int.TryParse(text, out mValue))
                {
                    SimpleMessageDialog.Show(Name, Common.Localize("Numeric:Error"));
                    return OptionResult.Failure;
                }
            }

            if ((lot != null) && (lot.IsResidentialLot))
            {
                int oldCost = lot.CalculateFurnitureWorth ();

                int baseCost = lot.Cost - oldCost;

                Dictionary<string,int> objects = new Dictionary<string,int>();

                foreach (GameObject obj in lot.GetObjects<GameObject> ())
                {
                    if (obj is AbstractArtObject) continue;
                    
                    if (obj is Fireplace) continue;
                    
                    if (obj is ImageObject) continue;

                    if (obj is Terrarium) continue;

                    obj.ValueModifier -= (int) (obj.PurchasedPrice * (mValue / 100f));

                    if (!objects.ContainsKey(obj.CatalogName))
                    {
                        objects.Add(obj.CatalogName, 1);
                    }
                    else
                    {
                        objects[obj.CatalogName]++;
                    }
                }

                int newCost = lot.CalculateFurnitureWorth();

                Common.Notify(Common.Localize("DepreciateHouse:Success", false, new object[] { lot.Name, baseCost + oldCost, baseCost + newCost }));
            }

            return OptionResult.SuccessClose;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:54,代码来源:Depreciate.cs

示例6: Run

        protected override OptionResult Run(Lot lot, Household house)
        {
            NRaas.MasterControllerSpace.Helpers.SortInventory.Item item = NRaas.MasterControllerSpace.Helpers.SortInventory.GetSortType(Name);
            if (item == null) return OptionResult.Failure;

            foreach (GameObject obj in lot.GetObjects<GameObject>())
            {
                NRaas.MasterControllerSpace.Helpers.SortInventory.Perform(obj.Inventory, item);
            }

            return OptionResult.SuccessClose;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:12,代码来源:SortLotInventory.cs

示例7: HomeInspection

        public HomeInspection(Lot lot)
        {
            foreach (GameObject obj in lot.GetObjects<GameObject>())
            {
                if (obj is IBedDouble)
                {
                    IBedDouble bed = obj as IBedDouble;
                    if (bed.NumberOfSpots() > 1)
                    {
                        mDoubleBeds++;
                    }
                }
                else if (obj is IBedSingle)
                {
                    IBedSingle bed = obj as IBedSingle;

                    mSingleBeds += bed.NumberOfSpots();
                }
                else if (obj is ICrib)
                {
                    mCribs++;
                }
                else if ((obj is IFridge) || (obj is IFutureFoodSynthesizer))
                {
                    mFridges++;
                }
                else if (obj is IBoxStall)
                {
                    mStalls++;
                }
                else if ((obj is IPetBed) || (obj is IPetHouse))
                {
                    mPetBeds++;
                }
                else if (obj is FairyHouse)
                {
                    mFairyHouses++;
                }
                else if (obj is IBotBed)
                {
                    mBotBeds++;
                }
                else if ((obj is IMailbox) || (obj is IResidentialTrashCan))
                {
                    continue;
                }

                mEmpty = false;
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:50,代码来源:HomeInspection.cs

示例8: IsValidLot

        protected static bool IsValidLot(Lot lot, FoodTruckBase truck)
        {
            if (lot == null) return false;

            FoodTruckBase existing = TruckController.GetTruck(lot);
            if (existing != null)
            {
                if (existing != truck) return false;
            }

            if (lot.StreetParking == null) return false;

            if (lot.IsWorldLot) return false;

            if (Traffic.Settings.mRequireFoodParkingSpace)
            {
                List<FoodTruckBase> trucks = new List<FoodTruckBase>(lot.GetObjects<FoodTruckBase>());
                trucks.Remove(truck);

                if ((lot.CountObjects<WideParkingSpace>() == 0x0) || (trucks.Count > 0x0))
                {
                    return false;
                }
            }

            if (lot.IsCommunityLot)
            {
                float openHour = 0f;
                float closingHour = 0f;
                if ((Bartending.TryGetHoursOfOperation(lot, ref openHour, ref closingHour)) && (!SimClock.IsTimeBetweenTimes(SimClock.HoursPassedOfDay, openHour, closingHour)))
                {
                    return false;
                }
            }
            else
            {
                if (lot.Household == null) return false;

                if (!Traffic.Settings.mAllowFoodTruckResidential) return false;

                if (lot.Household.IsActive)
                {
                    if (!Traffic.Settings.mAllowFoodTruckActiveLot) return false;
                }
            }

            return true;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:48,代码来源:FoodTruckManagerEx.cs

示例9: GetUnfurnishedCost

        public static int GetUnfurnishedCost(Lot lot)
        {
            int cost = lot.Cost;

            foreach (GameObject obj2 in lot.GetObjects<GameObject>())
            {
                if ((!obj2.StaysAfterEvict() && !obj2.IsInPublicResidentialRoom) && !obj2.IsInHiddenResidentialRoom)
                {
                    try
                    {
                        cost -= obj2.Value;
                    }
                    catch (Exception e)
                    {
                        Common.DebugException(lot, e);
                    }
                }
            }

            return cost;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:21,代码来源:Lots.cs

示例10: Run

        protected override OptionResult Run(Lot lot, Household me)
        {
            if (lot == null) return OptionResult.Failure;

            foreach (GameObject obj in lot.GetObjects<GameObject>())
            {
                if ((obj.InUse) || (!obj.InWorld)) continue;

                if (obj.Charred)
                {
                    obj.Charred = false;
                    if (obj is Windows)
                    {
                        RepairableComponent.CreateReplaceObject(obj);
                    }
                }

                RepairableComponent repairable = obj.Repairable;
                if ((repairable != null) && (repairable.Broken))
                {
                    repairable.ForceRepaired(Sim.ActiveActor);
                }
            }

            LotLocation[] burntTiles = World.GetBurntTiles(lot.LotId, LotLocation.Invalid);
            if (burntTiles.Length > 0x0)
            {
                foreach (LotLocation burnt in burntTiles)
                {
                    if ((lot.LotLocationIsPublicResidential(burnt)) && ((lot.TombRoomManager == null) || !lot.TombRoomManager.IsObjectInATombRoom(burnt)))
                    {
                        World.SetBurnt(lot.LotId, burnt, false);
                    }
                }
            }

            return OptionResult.SuccessClose;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:38,代码来源:RepairAll.cs

示例11: OnExitBuildBuy

 public void OnExitBuildBuy(Lot lot)
 {
     foreach (ISprinkler sprinkler in lot.GetObjects<ISprinkler>())
     {
         RemoveEAAlarms(sprinkler);
     }
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:SprinklerEx.cs

示例12: OnExitBuildBuy

 public void OnExitBuildBuy(Lot lot)
 {
     Door[] doors = lot.GetObjects<Door>();
     foreach (Door door in doors)
     {
         ReplaceComponent(door);
     }
 }
开发者ID:Chain-Reaction,项目名称:NRaas,代码行数:8,代码来源:DoorPortalComponentEx.cs

示例13: PrivateSatisfies

        protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting)
        {
            if (!inspecting)
            {
                if (!manager.GetValue<ManagerCareer.AssignSelfEmployedOption, bool>()) return false;
            }

            if ((mRequiredObjects == null) || (mRequiredObjects.Count == 0)) return true;

            if (newLot != null)
            {
                foreach (GameObject obj in newLot.GetObjects<GameObject>())
                {
                    if (Matches(obj.GetType())) return true;
                }
            }

            return false;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:19,代码来源:SkillDreamJob.cs

示例14: GetDetails

        public static string GetDetails(Lot lot, Household me)
        {
            string msg = null;
            if (me != null)
            {
                msg += Common.Localize("StatusHouse:HouseName", false, new object[] { me.Name });
            }

            if (lot != null)
            {
                msg += Common.Localize("StatusHouse:LotName", false, new object[] { lot.Name });
            }

            if (me != null)
            {
                msg += Common.Localize("StatusHouse:Funds", false, new object[] { me.FamilyFunds });

                if (me.RealEstateManager != null)
                {
                    int realEstate = 0;
                    foreach (PropertyData data in me.RealEstateManager.AllProperties)
                    {
                        realEstate += data.TotalValue;
                    }

                    msg += Common.Localize("StatusHouse:RealEstate", false, new object[] { realEstate });
                }


                if (lot != null)
                {
                    int taxes, savings, vacationHome;
                    GetTaxes(me, out taxes, out savings, out vacationHome);
                    msg += Common.Localize("StatusHouse:Taxes", false, new object[] { (taxes - vacationHome) + savings, vacationHome, savings, taxes });
                }
            }

            if (lot == null)
            {
                msg += Common.Localize("StatusHouse:Homeless");
            }
            else
            {
                msg += Common.Localize("StatusHouse:Address", false, new object[] { lot.Address, Lots.GetUnfurnishedCost(lot), lot.Cost - lot.GetUnfurnishedCost(), lot.Cost });

                int iFridges = 0, iCribs = 0, iSingleBeds = 0, iDoubleBeds = 0;

                List<IGameObject> lotObjects = new List<IGameObject>(lot.GetObjects<IGameObject>());
                foreach (IGameObject obj in lotObjects)
                {
                    if (obj is Sims3.Gameplay.Objects.Appliances.Fridge)
                    {
                        iFridges++;
                    }
                    else if (obj is ICrib)
                    {
                        iCribs++;
                    }
                    else if (obj is IBedDouble)
                    {
                        iDoubleBeds++;
                    }
                    else if (obj is IBedSingle)
                    {
                        iSingleBeds++;
                    }
                }

                msg += Common.Localize("StatusHouse:Objects", false, new object[] { iFridges, iCribs, iDoubleBeds, iSingleBeds });
            }

            if ((me != null) && (!SimTypes.IsService(me)))
            {
                int count = 0;
                string occupants = null;

                foreach (SimDescription sim in CommonSpace.Helpers.Households.All(me))
                {
                    occupants += Common.NewLine + sim.FullName;

                    count++;
                    if (count >= 24) break;
                }

                msg += Common.Localize("StatusHouse:Occupants", false, new object[] { occupants });
            }

            return msg;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:89,代码来源:StatusBase.cs

示例15: ChangeLotTypeHelper

        private static bool ChangeLotTypeHelper(Lot lot, bool deleteInvalidObjects, LotType newType, CommercialLotSubType commercialSubType, ResidentialLotSubType residentialSubType)
        {
            List<GameObject> objects = null;

            if (newType == LotType.Commercial)
            {
                // Custom
                //objects = lot.GetObjects<GameObject>(new Predicate<GameObject>(EditTownModel.IsNotValidCommunityLotObject));

                if (commercialSubType == CommercialLotSubType.kEP10_Resort)
                {
                    foreach (RabbitHole hole in lot.GetObjects<RabbitHole>(new Predicate<RabbitHole>(EditTownModel.IsInvestable)))
                    {
                        objects.Add(hole);
                    }

                    if (lot.ResortManager == null)
                    {
                        lot.ResortManager = new ResortManager(lot);
                    }
                }
            }
            else
            {
                // Custom
                //objects = lot.GetObjects<GameObject>(new Predicate<GameObject>(EditTownModel.IsNotValidResidentialLotObject));
            }

            if ((objects != null) && (objects.Count > 0))
            {
                if (!deleteInvalidObjects)
                {
                    return false;
                }

                foreach (GameObject obj2 in objects)
                {
                    int num = 0;
                    bool flag = false;
                    while (obj2.ActorsUsingMe.Count > num)
                    {
                        Sim sim = obj2.ActorsUsingMe[num];
                        if (sim != null)
                        {
                            sim.SetObjectToReset();
                            sim.InteractionQueue.PurgeInteractions(obj2);
                            flag = true;
                        }
                        num++;
                    }
                    if (flag)
                    {
                        SpeedTrap.Sleep(0);
                    }
                    lot.RemoveObjectFromLot(obj2.ObjectId, true);
                    obj2.Destroy();
                }

                ThumbnailKey key = new ThumbnailKey(new ResourceKey(lot.LotId, 0x436fee4c, 0), ThumbnailSize.Large);
                ThumbnailManager.InvalidateThumbnail(key);
                EditTownModel.UpdateDirtyLotThumbnailsTask(true);
            }

            if (lot.CommercialLotSubType == CommercialLotSubType.kEP10_Resort)
            {
                foreach (IResortBuffetTable table in lot.GetObjects<IResortBuffetTable>())
                {
                    table.ClearTable();
                }
            }

            if (GameStates.IsEditTownState)
            {
                BinCommon.KickSimsOffLot(lot, true);
            }

            return true;
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:78,代码来源:EditTownModelEx.cs


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