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