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


C# BaseBoat.IsComponentItem方法代码示例

本文整理汇总了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();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:90,代码来源:LighthouseAddon.cs


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