Exemple #1
0
        public MatchStrategyItem GetStrategyItem(MatchStrategyItem strategyItem = null)
        {
            if (strategyItem != null && strategyItem.Type > MatchStrategyType.NO)
            {
                return(strategyItem);
            }

            _default.Type  = PoorNetTimes > 0 ? MatchStrategyType.ROBOT : MatchStrategyType.NO;
            _default.Value = PoorNetTimes > 0 ? -1 : 0;
            return(_default);
        }
Exemple #2
0
 public MatchUser(int battleType, int fieldId, int serverId, int userId, string name, int score, int heroId,
                  List <int> towerPool, int criticalScale, TBattlePlayerAI aI, int robotUserId = 0, MatchStrategyItem strategy = null, List <int> recentPartners = null)
 {
     BattleId       = string.Empty;
     BattleType     = battleType;
     FieldId        = fieldId;
     ServerId       = serverId;
     UserId         = userId;
     UserName       = name;
     Score          = score;
     MatchScore     = strategy != null && strategy.Type == MatchStrategyType.BIGMAN ? strategy.Value : Score;
     StartTime      = 0;
     Hero           = new TBattleHero(heroId);
     TowerPool      = new List <int>(towerPool);
     CriticalScale  = criticalScale;
     PlayerAI       = aI;
     RobotUserId    = robotUserId;
     Strategy       = strategy;
     RecentPartners = recentPartners == null ? null : new List <int>(recentPartners);
     MaxTime        = GetMaxTime() * 1000;
 }