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


C# NetworkMessage.GetItem方法代码示例

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


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

示例1: ParseMessage

        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            int position = msg.Position;

            if (msg.GetByte() != (byte)IncomingPacketType.ContainerOpen)
                return false;

            Destination = destination;
            Type = IncomingPacketType.ContainerOpen;

            Id = msg.GetByte();
            ItemId = msg.GetUInt16();
            Name = msg.GetString();
            Capacity = msg.GetByte();
            HasParent = msg.GetByte();
            ItemCount = msg.GetByte();

            Items = new List<Tibia.Objects.Item>(ItemCount);

            for (int i = 0; i < ItemCount; i++)
            {
                Objects.Item item = msg.GetItem();
                item.Location = Tibia.Objects.ItemLocation.FromContainer(Id, (byte)i);
                Items.Add(item);
            }

            return true;
        }
开发者ID:Xileck,项目名称:tibiaapi,代码行数:28,代码来源:ContainerOpenPacket.cs

示例2: ParseMessage

        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            int position = msg.Position;

            if (msg.GetByte() != (byte)IncomingPacketType.ContainerAddItem)
                return false;

            Destination = destination;
            Type = IncomingPacketType.ContainerAddItem;

            Container = msg.GetByte();
            Item = msg.GetItem();

            return true;
        }
开发者ID:FaNtA91,项目名称:pokemonapi,代码行数:15,代码来源:ContainerAddItemPacket.cs

示例3: ParseMessage

        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            int position = msg.Position;

            if (msg.GetByte() != (byte)IncomingPacketType.InventorySetSlot)
                return false;

            Destination = destination;
            Type = IncomingPacketType.InventorySetSlot;

            Slot = msg.GetByte();

            Item = msg.GetItem();

            return true;
        }
开发者ID:FaNtA91,项目名称:pokemonapi,代码行数:16,代码来源:InventorySetSlotPacket.cs

示例4: ParseMessage

        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            int position = msg.Position;

            if (msg.GetByte() != (byte)IncomingPacketType.SafeTradeRequestNoAck)
                return false;

            Destination = destination;
            Type = IncomingPacketType.SafeTradeRequestNoAck;

            Name = msg.GetString();
            Count = msg.GetByte();

            Items = new List<Tibia.Objects.Item>(Count);

            for (int i = 0; i < Count; i++)
            {
                Objects.Item item = msg.GetItem();

                Items.Add(item);
            }

            return true;
        }
开发者ID:Xileck,项目名称:tibiaapi,代码行数:24,代码来源:SafeTradeRequestNoAckPacket.cs


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