コード例 #1
0
 private void AddRequestIfRelevant(BotRequest request, Team team)
 {
     if (RequestIsRelevant(request, team))
     {
         Expectations[team].Add(request);
     }
 }
コード例 #2
0
ファイル: BotRequester.cs プロジェクト: Qazzquimby/Lindholm2
        public void RequestBot(Team team, AiHero hero, Difficulty difficulty, IBotRule rule, int minPlayersOnTeam,
                               int maxPlayersOnTeam)
        {
            BotRequest newRequest = new BotRequest(team, hero, difficulty, rule, minPlayersOnTeam, maxPlayersOnTeam);

            _botRequests.Requests.Add(newRequest);
        }
コード例 #3
0
        private bool RequestIsRelevant(BotRequest request, Team team)
        {
            bool requestIsOnCorrectTeam = request.BotTeam == team;
            bool playerCountInRange     = _slots.Players.Count(team) >= request.MinPlayersOnTeam && _slots.Players.Count(team) <= request.MaxPlayersOnTeam;
            bool ruleFollowed           = GetRuleIsFollowed(request.Rule, team);

            return(requestIsOnCorrectTeam && playerCountInRange && ruleFollowed);
        }
コード例 #4
0
 public void AddBot(BotRequest request)
 {
     AddBot(request.Hero, request.Difficulty, request.BotTeam);
 }