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


C# Lot.RemoveObjectFromLot方法代码示例

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


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

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