本文整理汇总了C#中BlueSheep.Interface.AccountUC.AddItem方法的典型用法代码示例。如果您正苦于以下问题:C# AccountUC.AddItem方法的具体用法?C# AccountUC.AddItem怎么用?C# AccountUC.AddItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlueSheep.Interface.AccountUC
的用法示例。
在下文中一共展示了AccountUC.AddItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObjectAddedMessageTreatment
public static void ObjectAddedMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
ObjectAddedMessage msg = (ObjectAddedMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
ObjectItem item = [email protected];
Core.Inventory.Item i = new Core.Inventory.Item(item.Effects.ToList(), item.ObjectGID, item.Position, item.Quantity, item.ObjectUID, account);
account.Inventory.Items.Add(i);
string[] row1 = { i.GID.ToString(), i.UID.ToString(), i.Name, i.Quantity.ToString(), i.Type.ToString(), i.Price.ToString() };
System.Windows.Forms.ListViewItem li = new System.Windows.Forms.ListViewItem(row1);
li.ToolTipText = i.Description;
account.AddItem(li, account.LVItems);
if (i.Type == "Sac de ressource")
{
foreach (JobUC uc in account.JobsUC)
{
if (uc.OpenBagCb.Checked)
{
account.Inventory.UseItem(i.UID);
account.Log(new ActionTextInformation("Ouverture automatique d'un sac de récolte : " + i.Name), 2);
}
}
}
if (account.Running != null)
{
foreach (Pet pet in account.petsList)
pet.SetFood();
}
}
示例2: ObjectAddedMessageTreatment
public static void ObjectAddedMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
{
ObjectAddedMessage msg = (ObjectAddedMessage)message;
using (BigEndianReader reader = new BigEndianReader(packetDatas))
{
msg.Deserialize(reader);
}
ObjectItem item = [email protected];
Core.Inventory.Item i = new Core.Inventory.Item(item.Effects.ToList(), item.ObjectGID, item.Position, item.Quantity, item.ObjectUID, account);
account.Inventory.Items.Add(i);
string[] row1 = { i.GID.ToString(), i.UID.ToString(), i.Name, i.Quantity.ToString(), i.Type.ToString(), i.Price.ToString() };
System.Windows.Forms.ListViewItem li = new System.Windows.Forms.ListViewItem(row1);
li.ToolTipText = i.Description;
account.AddItem(li, account.LVItems);
if (account.Running != null)
{
foreach (Pet pet in account.petsList)
pet.SetFood();
}
}