本文整理汇总了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;
}