當前位置: 首頁>>代碼示例>>C#>>正文


C# Model.GameUser類代碼示例

本文整理匯總了C#中ZyGames.Tianjiexing.Model.GameUser的典型用法代碼示例。如果您正苦於以下問題:C# GameUser類的具體用法?C# GameUser怎麽用?C# GameUser使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GameUser類屬於ZyGames.Tianjiexing.Model命名空間,在下文中一共展示了GameUser類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetOpenGoldNum

        public static int GetOpenGoldNum(int enableNum, int userGridNum)
        {
            int latticeSpar = 0; //開啟每個格子的價格
            int Sum = 0;
            int Sub = 0;
            int minGridNum = new GameUser().SparePartMinGridNum;
            int subGridNum = MathUtils.Subtraction(enableNum, minGridNum, 0);

            int minusNum = MathUtils.Subtraction(userGridNum, minGridNum, 0);
            for (int i = 1; i <= subGridNum; i++)
            {
                if (i == 0) latticeSpar = 0;
                if (i == 1) latticeSpar = 2;
                if (i >= 2) latticeSpar = i * 2;
                Sum += latticeSpar;
            }

            for (int j = 0; j <= minusNum; j++)
            {
                if (j == 0) latticeSpar = 0;
                if (j == 1) latticeSpar = 2;
                if (j >= 2) latticeSpar = j * 2;
                Sub += latticeSpar;
            }
            return MathUtils.Subtraction(Sum, Sub, 0);
        }
開發者ID:rongxiong,項目名稱:Scut,代碼行數:26,代碼來源:Action1215.cs

示例2: CheckUserPlotHurdleNum

        /// <summary>
        /// 天地劫副本關數
        /// </summary>
        /// <param name="user"></param>
        public static int CheckUserPlotHurdleNum(GameUser user)
        {
            int hurdleNum = 0;
            PlotInfo plotInfo = CheckUserPlotKalpa(user);
            if (plotInfo != null)
            {
                UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(user.UserID);
                if (dailyRestrain != null && dailyRestrain.UserExtend != null && dailyRestrain.UserExtend.KalpaDate.Date == DateTime.Now.Date)
                {
                    hurdleNum = user.UserExtend.HurdleNum;
                }
                else
                {
                    hurdleNum = plotInfo.PlotSeqNo;

                    if (user.UserExtend != null && hurdleNum > 0)
                    {
                        user.UserExtend.UpdateNotify(obj =>
                            {
                                user.UserExtend.HurdleNum = hurdleNum;
                                return true;
                            });
                        //user.Update();
                    }
                }
            }
            else
            {
                hurdleNum = 1;
            }
            return hurdleNum;
        }
開發者ID:rongxiong,項目名稱:Scut,代碼行數:36,代碼來源:Action4301.cs

示例3: IsBeiBaoFull

        //判斷背包是否已滿
        public static bool IsBeiBaoFull(GameUser user, int itembaseId)
        {
            ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(itembaseId);
            if (itemInfo != null)
            {
                var package = UserItemPackage.Get(user.UserID);

                //查找出所有已用的格子
                var userItemArray = package.ItemPackage.FindAll(m => !m.IsRemove && m.ItemStatus == ItemStatus.BeiBao);

                //查找出已用格子中是相同物品格子的數量
                var itemmountArray = package.ItemPackage.FindAll(m => !m.IsRemove && m.ItemStatus == ItemStatus.BeiBao && m.ItemID == itembaseId);

                int totalNum = 0;
                //累加所有的該物品的數量
                foreach (UserItemInfo userItemInfo in itemmountArray)
                {
                    totalNum = MathUtils.Addition(totalNum, userItemInfo.Num);
                }
                //是否有空餘位置
                int mount = totalNum % itemInfo.PackMaxNum;

                if (userItemArray.Count >= user.GridNum && mount == 0)
                {
                    return true;
                }
            }
            return false;
        }
開發者ID:0jpq0,項目名稱:Scut,代碼行數:30,代碼來源:Action7004.cs

示例4: AddExprerience

 public static void AddExprerience(GameUser user, int experience)
 {
     string userID = user.UserID;
     var userEmbattleList = new GameDataCacheSet<UserEmbattle>().FindAll(userID, m => m.MagicID == user.UseMagicID);
     HashSet<int> generalHash = new HashSet<int>();
     foreach (UserEmbattle userEmbattle in userEmbattleList)
     {
         //wuzf 8-18 修複多個相同傭兵陣形數據
         if (generalHash.Contains(userEmbattle.GeneralID))
         {
             userEmbattle.GeneralID = 0;
             //userEmbattle.Update();
             continue;
         }
         else
         {
             generalHash.Add(userEmbattle.GeneralID);
         }
         //UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(userID, userEmbattle.GeneralID);
         //if (userGeneral != null)
         //{
         //    userGeneral.CurrExperience = MathUtils.Addition(userGeneral.CurrExperience, experience);
         //}
     }
     //UserHelper.UserGeneralExp(user.UserID, experience);
 }
開發者ID:0jpq0,項目名稱:Scut,代碼行數:26,代碼來源:PlotHelper.cs

示例5: DailySportsRankPrize

        /// <summary>
        /// 競技場每日獎勵
        /// </summary>
        /// <param name="user"></param>
        public static void DailySportsRankPrize(GameUser user)
        {
            UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(user.UserID);
            if (IsGainSportsReward(user.UserID) && dailyRestrain != null && dailyRestrain.UserExtend != null)
            {
                //var envSet = ServerEnvSet.Get(ServerEnvKey.JingJiChangReward, "");
                SportsRewardInfo sportsInfo = new ConfigCacheSet<SportsRewardInfo>().FindKey(dailyRestrain.UserExtend.UserRankID);
                //if (envSet != null && sportsInfo != null && envSet.ToDateTime().Date > dailyRestrain.Funtion11.Date &&
                // dailyRestrain.UserExtend.UserRankID > 0)
                if (sportsInfo != null && DateTime.Now.Date != dailyRestrain.Funtion11.Date &&
                 dailyRestrain.UserExtend.UserRankID > 0)
                {
                    dailyRestrain.Funtion11 = DateTime.Now;
                    dailyRestrain.UserExtend.UserRankID = 0;

                    user.SportsIntegral = MathUtils.Addition(user.SportsIntegral, sportsInfo.RewardObtian,
                                                             int.MaxValue);
                    user.GameCoin = MathUtils.Addition(user.GameCoin, sportsInfo.RewardGoin, int.MaxValue);
                    string sportContent = string.Format(LanguageManager.GetLang().St5106_JingJiChangRankReward,
                                                        sportsInfo.RewardObtian, sportsInfo.RewardGoin);
                    var chatService = new TjxChatService();
                    chatService.SystemSendWhisper(user, sportContent);
                }
            }
        }
開發者ID:wf15271760803,項目名稱:Scut-samples,代碼行數:29,代碼來源:RankingHelper.cs

示例6: RankNotice

 /// <summary>
 /// 排行榜公告
 /// </summary>
 public static void RankNotice(GameUser user)
 {
     RankLvNotice(user);
     RankObtionNotice(user);
     RankCoinNotice(user);
     RankCombatNumNotice(user);
 }
開發者ID:daneric,項目名稱:Scut-samples,代碼行數:10,代碼來源:NoticeHelper.cs

示例7: FathersDay

 /// <summary>
 /// 父親節獎勵
 /// </summary>
 public static void FathersDay(GameUser user)
 {
     short energyNum = 30;
     int obtainNum = 50;
     int gameGoin = 20000;
     string fatherTime = "2012-06-17 00:00:00";
     DateTime fatherDate = DateTime.Parse(fatherTime);
     UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(user.UserID);
     if (dailyRestrain != null && dailyRestrain.Funtion13 < 1)
     {
         if (DateTime.Now.Date == fatherDate.Date)
         {
             dailyRestrain.Funtion13 = 1;
             //dailyRestrain.Update();
             user.EnergyNum = MathUtils.Addition(user.EnergyNum, energyNum, short.MaxValue);
             user.ObtainNum = MathUtils.Addition(user.ObtainNum, obtainNum, int.MaxValue);
             user.GameCoin = MathUtils.Addition(user.GameCoin, gameGoin, int.MaxValue);
             //user.Update();
             string content = string.Format(LanguageManager.GetLang().St_FathersDay,
                                            energyNum, obtainNum,
                                            gameGoin);
             new TjxChatService().SystemSendWhisper(user, content);
         }
     }
 }
開發者ID:jinfei426,項目名稱:Scut,代碼行數:28,代碼來源:ActivitiesAward.cs

示例8: TakeAction

 public override bool TakeAction()
 {
     _gameUser = new GameDataCacheSet<GameUser>().FindKey(ContextUser.UserID);
     _cityInfoArray = new ConfigCacheSet<CityInfo>().FindAll(c => c.CityType == 0 &&
         c.MinLv <= _gameUser.UserLv &&
         ((int)c.CountryID == 0 || c.CountryID == ContextUser.CountryID));
     return true;
 }
開發者ID:jinfei426,項目名稱:Scut,代碼行數:8,代碼來源:Action2001.cs

示例9: TriggerArchaeologyPlot

 /// <summary>
 /// 考古戰役
 /// </summary>
 /// <param name="user"></param>
 /// <param name="plotNpcID"></param>
 /// <returns></returns>
 public static ISingleCombat TriggerArchaeologyPlot(GameUser user, int plotNpcID)
 {
     ICombatController controller = new TjxCombatController();
     ISingleCombat plotCombater = controller.GetSingleCombat(CombatType.KaoGuPlot);
     plotCombater.SetAttack(new UserEmbattleQueue(user.UserID, user.UseMagicID));
     plotCombater.SetDefend(new MonsterQueue(plotNpcID));
     return plotCombater;
 }
開發者ID:daneric,項目名稱:Scut-samples,代碼行數:14,代碼來源:CombatFactory.cs

示例10: TriggerSJTPlot

 /// <summary>
 /// 聖吉塔戰役
 /// </summary>
 /// <param name="user"></param>
 /// <param name="plotNpcID"></param>
 /// <returns></returns>
 public static ISingleCombat TriggerSJTPlot(GameUser user, int plotNpcID, double difficultNum)
 {
     ICombatController controller = new TjxCombatController();
     ISingleCombat plotCombater = controller.GetSingleCombat(CombatType.ShengJiTa);
     plotCombater.SetAttack(new UserEmbattleQueue(user.UserID, user.UseMagicID));
     plotCombater.SetDefend(new MonsterQueue(plotNpcID, difficultNum));
     return plotCombater;
 }
開發者ID:daneric,項目名稱:Scut-samples,代碼行數:14,代碼來源:CombatFactory.cs

示例11: TriggerPlot

 /// <summary>
 /// 副本戰役
 /// </summary>
 /// <param name="user"></param>
 /// <param name="plotNpcID"></param>
 /// <returns></returns>
 public static ISingleCombat TriggerPlot(GameUser user, int plotNpcID)
 {
     //TrumpAbilityAttack.CombatTrumpLift(user.UserID); //法寶每戰鬥M次就扣除N點壽命
     ICombatController controller = new TjxCombatController();
     ISingleCombat plotCombater = controller.GetSingleCombat(CombatType.Plot);
     plotCombater.SetAttack(new UserEmbattleQueue(user.UserID, user.UseMagicID));
     plotCombater.SetDefend(new MonsterQueue(plotNpcID));
     return plotCombater;
 }
開發者ID:daneric,項目名稱:Scut-samples,代碼行數:15,代碼來源:CombatFactory.cs

示例12: IsMeet

 /// <summary>
 /// 是否滿足培養條件
 /// </summary>
 /// <param name="user"></param>
 /// <param name="culTure"></param>
 /// <returns></returns>
 public static bool IsMeet(GameUser user, EnchantCulTure culTure)
 {
     if ((culTure.CultureType == EnchantCultureType.Ordinary && user.UserExtend != null && user.UserExtend.MoJingNum >= culTure.MoJingNum)
         || (user.GoldNum >= culTure.GoldNum && culTure.CultureType != EnchantCultureType.Ordinary))
     {
         return true;
     }
     return false;
 }
開發者ID:0jpq0,項目名稱:Scut,代碼行數:15,代碼來源:Action1257.cs

示例13: GetNoviceActivities

        /// <summary>
        /// 新手禮包
        /// </summary>
        /// <param name="user"></param>
        /// <param name="item"></param>
        /// <param name="noviceActivities"></param>
        /// <returns></returns>
        public static bool GetNoviceActivities(GameUser user, UserItemInfo item, NoviceActivities noviceActivities)
        {
            List<NoviceReward> noviceArray = noviceActivities.Reward.ToList();
            var package = UserItemPackage.Get(user.UserID);
            var userItemArray = package.ItemPackage.FindAll(m => !m.IsRemove && m.ItemStatus == ItemStatus.BeiBao);
            int subPackNum = MathUtils.Subtraction(user.GridNum, MathUtils.Subtraction(userItemArray.Count, 5, 0), 0);
            if (noviceArray.Count > subPackNum)
            {
                return false;
            }

            bool isupdate = false;

            foreach (NoviceReward reward in noviceArray)
            {
                if (reward.Type == 1)
                {
                    isupdate = true;
                    user.EnergyNum = MathUtils.Addition(user.EnergyNum, (short)reward.Num, short.MaxValue);
                }
                if (reward.Type == 2)
                {
                    isupdate = true;
                    user.GameCoin = MathUtils.Addition(user.GameCoin, reward.Num, int.MaxValue);
                }
                else if (reward.Type == 3)
                {
                    ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(reward.Reward);
                    UserGeneral userGeneral = UserGeneral.GetMainGeneral(user.UserID);
                    if (itemInfo.ItemType == ItemType.ZhuangBei && !itemInfo.CheckCareer(userGeneral.CareerID))
                    {
                        continue;
                    }
                    UserItemHelper.AddUserItem(user.UserID, itemInfo.ItemID, reward.Num);
                }
                else if (reward.Type == 4)
                {
                    //晶石
                    isupdate = true;
                    user.GiftGold = MathUtils.Addition(user.GiftGold, reward.Num, int.MaxValue);
                }
            }
            UserItemHelper.UseUserItem(user.UserID, item.ItemID, 1);

            if (isupdate)
            {
                //user.Update();
            }

            if (item.ItemID == 5000 || item.ItemID == 5001 ||
                item.ItemID == 5002 || item.ItemID == 5003)
            {
                int itemID = MathUtils.Addition(item.ItemID, 1, int.MaxValue);
                UserItemHelper.AddUserItem(user.UserID, itemID, 1);
            }
            return true;
        }
開發者ID:rongxiong,項目名稱:Scut,代碼行數:64,代碼來源:Action1606.cs

示例14: Trigger

 /// <summary>
 /// 獲取個人元寶
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public static void Trigger(GameUser user)
 {
     var trigger = new PaymentTrigger(GetPayment);
     trigger.BeginInvoke(user.GameId, user.ServerId, user.Pid, user.UserID, null, null);
     int vipLv;
     int vipGold = MathUtils.Addition(user.PayGold, user.ExtGold, int.MaxValue);
     List<VipLvInfo> vipLvArray = new ShareCacheStruct<VipLvInfo>().FindAll(u => u.PayGold <= vipGold);
     vipLv = vipLvArray.Count > 0 ? vipLvArray[vipLvArray.Count - 1].VipLv : (short)0;
     user.VipLv = vipLv;
     //user.Update();
 }
開發者ID:daneric,項目名稱:Scut-samples,代碼行數:16,代碼來源:PaymentService.cs

示例15: CheckAllowCrystall

 /// <summary>
 /// 檢查是否能獵命
 /// </summary>
 /// <returns></returns>
 public static bool CheckAllowCrystall(GameUser user)
 {
     var package = UserCrystalPackage.Get(user.UserID);
     int currNum = 0;
     if (package != null)
     {
         currNum = package.CrystalPackage.FindAll(m => m.IsSale == 1).Count;
         currNum += user.GrayCrystalList == null ? 0 : user.GrayCrystalList.Count;
     }
     return currNum < _crystalGridNum;
 }
開發者ID:jinfei426,項目名稱:Scut,代碼行數:15,代碼來源:CrystalHelper.cs


注:本文中的ZyGames.Tianjiexing.Model.GameUser類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。