示例#1
0
        public void SetBattleResultData(NoticeType resType, BattleResultData resInfo, bool isPlayBack = false)
        {
            resultInfo = resInfo;

            #region Judge winning or losing

            if (resType == NoticeType.BattleResultBlueWin)
            {
                switch (myselfMatchSide)
                {
                case MatchSide.Red:
                    currentResultType = BattleResultType.Lose;
                    break;

                case MatchSide.Blue:
                    currentResultType = BattleResultType.Win;
                    break;
                }
                redVictroy = false;
            }
            else if (resType == NoticeType.BattleResultRedWin)
            {
                switch (myselfMatchSide)
                {
                case MatchSide.Red:
                    currentResultType = BattleResultType.Win;
                    break;

                case MatchSide.Blue:
                    currentResultType = BattleResultType.Lose;
                    break;
                }
                redVictroy = true;
            }

            #endregion

            view.RefreshBattleResult();

            if (!isPlayBack)
            {
                DataManager dataM = DataManager.GetInstance();

                dataM.SetPlayerExp(resInfo.currentExp);
                int currentGold = dataM.GetPlayerGold();
                dataM.SetPlayerGold(currentGold += resInfo.gainGold);
                dataM.SetPlayerLevel(resInfo.playerLevel);
            }
        }
示例#2
0
        private void Update(Action updateAction, string name, BattleResultType battleResultType = BattleResultType.Normal)
        {
            this.Name        = name;
            this.IsInBattle  = true;
            this.UpdatedTime = DateTimeOffset.Now;

            updateAction();

            if (battleResultType == BattleResultType.Normal)
            {
                this.BattleResult = this.PredictResult();
            }
            else
            {
                this.BattleResult = this.PredictResult2();
            }
        }
示例#3
0
 // Extension methods
 public static UserAllianceActivityData AddBattleResult(this UserAllianceActivityData data, DateTime now, AreaTypeId areaId, BattleResultType resultType) => default;
示例#4
0
 // Methods
 public void RecordBattle(BattleResultType type, DateTime time)
 {
 }
 public static void UpdateArenaStats(this UserStatsData data, BattleResultType resultType)
 {
 }
 // Extension methods
 public static UserStatsData AddBattleResult(this UserStatsData data, AreaTypeId areaId, BattleResultType resultType, bool isAutoBattle = false) => default;