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


C# Lot.GetAllActors方法代码示例

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


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

示例1: Run


//.........这里部分代码省略.........
                    {
                        foreach (Slot slot in awayable.GetContainmentSlots())
                        {
                            if (awayable.GetContainedObject(slot) is Bar.Glass)
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    if (!flag)
                    {
                        awayable.ThrowAwayImmediately();
                    }
                }

                if (obj is IDestroyOnMagicalCleanup)
                {
                    obj.FadeOut(false, true);
                }
            }

            lot.FireManager.RestoreObjects();

            LotLocation[] puddles = World.GetPuddles(lot.LotId, LotLocation.Invalid);
            if (puddles.Length > 0x0)
            {
                foreach (LotLocation location in puddles)
                {
                    if ((lot.TombRoomManager == null) || !lot.TombRoomManager.IsObjectInATombRoom(location))
                    {
                        PuddleManager.RemovePuddle(lot.LotId, location);
                    }
                }
            }

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

            if (me != null)
            {
                List<Fridge> fridges = new List<Fridge>(lot.GetObjects<Fridge>());
                if (fridges.Count > 0)
                {
                    Fridge fridge = fridges[0];
                    if ((fridge != null) &&
                        (me.SharedFridgeInventory != null) &&
                        (me.SharedFamilyInventory.Inventory != null))
                    {
                        foreach (ServingContainer container in Sims3.Gameplay.Queries.GetObjects<ServingContainer>(lot))
                        {
                            if ((!container.InUse) &&
                                (fridge.HandToolAllowDragDrop(container)) &&
                                (container.HasFood) && 
                                (container.HasFoodLeft()) &&
                                (!container.IsSpoiled) &&
                                (container.GetQuality() >= Quality.Neutral))
                            {
                                me.SharedFridgeInventory.Inventory.TryToAdd(container, false);
                            }
                        }
                    }
                }
            }

            foreach (Sim sim in lot.GetAllActors())
            {
                if (sim.Inventory == null) continue;

                foreach (IThrowAwayable awayable in sim.Inventory.FindAll<IThrowAwayable>(true))
                {
                    if (awayable == null) continue;

                    if (!awayable.HandToolAllowUserPickupBase()) continue;

                    if (!awayable.ShouldBeThrownAway()) continue;

                    if (awayable.InUse) continue;

                    if ((awayable is Newspaper) && !(awayable as Newspaper).IsOld) continue;

                    if (awayable is TrashPileOpportunity) continue;

                    if ((awayable is PreparedFood) && !(awayable as PreparedFood).IsSpoiled) continue;

                    awayable.ThrowAwayImmediately();
                }
            }

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

示例2: RegisterRoomListeners

            public static void RegisterRoomListeners(Lot lot)
            {
                if (lot != null && !mRegistered.Contains(lot.LotId) && !lot.IsWorldLot)
                {
                    LotDisplayLevelInfo info = World.LotGetDisplayLevelInfo(lot.LotId);

                    for (int i = info.mMin; i <= info.mMax; i++)
                    {
                        foreach (int room in World.GetInsideRoomsAtLevel(lot.LotId, i, eRoomDefinition.LightBlocking))
                        {
                            List<Lot.OnAllowedInRoomCheck> list;
                            if (!lot.mRoomRestrictionCheckCallbacks.TryGetValue(room, out list))
                            {
                                list = new List<Lot.OnAllowedInRoomCheck>();
                                lot.mRoomRestrictionCheckCallbacks.Add(room, list);
                            }
                            if (!list.Contains(new Lot.OnAllowedInRoomCheck(OnAllowedInRoomCheck)))
                            {
                                list.Add(new Lot.OnAllowedInRoomCheck(OnAllowedInRoomCheck));
                            }
                        }
                    }

                    foreach (Sim sim in lot.GetAllActors())
                    {
                        if (sim != null)
                        {
                            sim.mAllowedRooms.Remove(lot.LotId);
                        }
                    }

                    mRegistered.Add(lot.LotId);
                }                             
            }
开发者ID:Chain-Reaction,项目名称:NRaas,代码行数:34,代码来源:DoorPortalComponentEx.cs


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