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


C# PlayerBussiness.GetUserBagByType方法代码示例

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

        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:16,代码来源:CommonPage.cs

示例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();
            }

        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:55,代码来源:PlayerInventory.cs

示例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();
            }

        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:24,代码来源:CommonPage.cs

示例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();
                    }
                }
            }
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:24,代码来源:PlayerInventory.cs


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