本文整理汇总了C#中Bussiness.PlayerBussiness.GetUserBagByType方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.GetUserBagByType方法的具体用法?C# PlayerBussiness.GetUserBagByType怎么用?C# PlayerBussiness.GetUserBagByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.GetUserBagByType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadFromDatabase
/// <summary>
/// 从数据库中加载
/// </summary>
/// <param name="playerId"></param>
public void LoadFromDatabase(int playerId)
{
using (PlayerBussiness pb = new PlayerBussiness())
{
ItemInfo[] list = pb.GetUserBagByType(playerId, _bagType);
foreach (ItemInfo item in list)
{
_items[item.Place] = item;
}
}
}
示例2: LoadFromDatabase
/// <summary>
/// 从数据库中加载
/// </summary>
/// <param name="playerId"></param>
public void LoadFromDatabase(int playerId)
{
using (PlayerBussiness pb = new PlayerBussiness())
{
//ItemInfo[] list = pb.GetUserItem(playerId);
ItemInfo[] list = pb.GetUserBagByType(playerId, _bagType);
foreach (ItemInfo item in list)
{
_items[item.Place] = item;
}
for (int i = 0; i < 11; i++)
{
ItemInfo item = _items[i];
if (item == null)
continue;
if (!_items[i].IsValidItem())
{
UpdatePlayerProperties(item, false);
int place = base.FindFirstEmptySlot(11);
if (place != -1)
{
MoveItem(item.Place, place);
}
else
{
MailInfo mail = new MailInfo();
mail.Annex1 = item.ItemID.ToString();
mail.Content = "物品已过期!";
mail.Gold = 0;
mail.IsExist = true;
mail.Money = 0;
mail.Receiver = _player.PlayerCharacter.NickName;
mail.ReceiverID = item.UserID;
mail.Sender = _player.PlayerCharacter.NickName;
mail.SenderID = item.UserID;
mail.Title = "物品已过期!";
if (pb.SendMail(mail))
{
item.UserID = 0;
RemoveItem(item);
}
}
}
}
UpdatePlayerProperties();
}
}
示例3: LoadFromDatabase
/// <summary>
/// 从数据库中加载
/// </summary>
/// <param name="playerId"></param>
public void LoadFromDatabase(int playerId)
{
using (PlayerBussiness pb = new PlayerBussiness())
{
ItemInfo[] list = pb.GetUserBagByType(playerId, _bagType);
foreach (ItemInfo item in list)
{
if (item.Place >= _count || item.Place < 0)
continue;
m_items[item.Place] = item;
}
}
if (_bagType == 11)
{
SendStoreToMail();
}
}
示例4: LoadFromDatabase
public virtual void LoadFromDatabase()
{
if (m_saveToDb)
{
using (PlayerBussiness pb = new PlayerBussiness())
{
ItemInfo[] list = pb.GetUserBagByType(m_player.PlayerCharacter.ID, BagType);
BeginChanges();
try
{
foreach (ItemInfo item in list)
{
AddItemTo(item, item.Place);
}
}
finally
{
CommitChanges();
}
}
}
}