本文整理汇总了C#中Server.Multis.BaseBoat.IsComponentItem方法的典型用法代码示例。如果您正苦于以下问题:C# BaseBoat.IsComponentItem方法的具体用法?C# BaseBoat.IsComponentItem怎么用?C# BaseBoat.IsComponentItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Multis.BaseBoat
的用法示例。
在下文中一共展示了BaseBoat.IsComponentItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DockBoat
public void DockBoat(BaseBoat boat, BaseHouse house)
{
List<ISpawnable> list = boat.GetMovingEntities();
foreach (ISpawnable o in list)
{
if (!(o is Item) || o == this || boat.IsComponentItem(o) || o is EffectItem || o == boat.TillerMan)
continue;
Item item = o as Item;
if (!item.Deleted && boat.Contains(item))
{
if (item is AddonComponent || item is BaseAddon)
{
BaseAddon addon = item is AddonComponent ? ((AddonComponent)item).Addon : (BaseAddon)item;
Item deed = addon.Deed;
bool retainDeedHue = false;
int hue = 0;
if (addon != null && addon.RetainDeedHue)
{
retainDeedHue = true;
for (int j = 0; hue == 0 && j < addon.Components.Count; ++j)
{
AddonComponent c = addon.Components[j];
if (c.Hue != 0)
hue = c.Hue;
}
}
if (deed != null)
{
if (retainDeedHue)
deed.Hue = hue;
house.DropToMovingCrate(deed);
}
}
else
{
item.Delete();
}
}
Container cont;
if (boat is BaseGalleon)
cont = ((BaseGalleon)boat).GalleonHold;
else
cont = boat.Hold;
if (cont != null)
{
cont.Items.ForEach(i =>
{
if (i is BaseWeapon)
house.DropToMovingCrate(i);
else
i.Delete();
});
}
}
BaseDockedBoat model = boat.BoatItem;
if (model == null || model.Deleted)
model = boat.DockedBoat;
if (model == null)
return;
model.BoatItem = boat;
if (boat.IsClassicBoat && boat.Owner != null)
boat.RemoveKeys(boat.Owner);
house.DropToMovingCrate(model);
boat.OnDryDock();
boat.Refresh();
boat.Internalize();
list.Clear();
list.TrimExcess();
}