本文整理汇总了C#中NetGore.IO.BitStream.ReadInventorySlot方法的典型用法代码示例。如果您正苦于以下问题:C# BitStream.ReadInventorySlot方法的具体用法?C# BitStream.ReadInventorySlot怎么用?C# BitStream.ReadInventorySlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetGore.IO.BitStream
的用法示例。
在下文中一共展示了BitStream.ReadInventorySlot方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RecvSwapInventorySlots
void RecvSwapInventorySlots(IIPSocket conn, BitStream r)
{
var a = r.ReadInventorySlot();
var b = r.ReadInventorySlot();
var user = TryGetUser(conn);
if (user == null)
return;
user.Inventory.SwapSlots(a, b);
}
示例2: RecvUseInventoryItem
void RecvUseInventoryItem(IIPSocket conn, BitStream r)
{
var slot = r.ReadInventorySlot();
User user;
if ((user = TryGetUser(conn)) == null)
return;
user.UseInventoryItem(slot);
}
示例3: RecvSellInventoryToShop
void RecvSellInventoryToShop(IIPSocket conn, BitStream r)
{
var slot = r.ReadInventorySlot();
var amount = r.ReadByte();
User user;
if ((user = TryGetUser(conn)) == null)
return;
user.ShoppingState.TrySellInventory(slot, amount);
}
示例4: RecvGetInventoryItemInfo
void RecvGetInventoryItemInfo(IIPSocket conn, BitStream r)
{
var slot = r.ReadInventorySlot();
User user;
if ((user = TryGetUser(conn)) != null)
user.SendInventoryItemStats(slot);
}
示例5: RecvDropInventoryItem
void RecvDropInventoryItem(IIPSocket conn, BitStream r)
{
var slot = r.ReadInventorySlot();
var amount = r.ReadByte();
User user;
if ((user = TryGetUser(conn)) == null)
return;
if (user.IsPeerTrading)
return;
if (amount < 1)
return;
user.Inventory.Drop(slot, amount);
}
示例6: RecvSetInventorySlot
void RecvSetInventorySlot(IIPSocket conn, BitStream r)
{
var slot = r.ReadInventorySlot();
var hasGraphic = r.ReadBool();
var graphic = hasGraphic ? r.ReadGrhIndex() : GrhIndex.Invalid;
var amount = r.ReadByte();
UserInfo.Inventory.Update(slot, graphic, amount, GetTime());
}
示例7: RecvSendInventoryItemInfo
void RecvSendInventoryItemInfo(IIPSocket conn, BitStream r)
{
var slot = r.ReadInventorySlot();
GameplayScreen.InventoryInfoRequester.ReceiveInfo(slot, r);
}