Пример #1
0
        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);
        }
Пример #2
0
        internal BotRequest(Team team, AiHero hero, Difficulty difficulty, IBotRule rule, int minPlayersOnTeam, int maxPlayersOnTeam)
        {
            if (minPlayersOnTeam < 0 || minPlayersOnTeam > 5)
            {
                throw (new ArgumentOutOfRangeException(nameof(minPlayersOnTeam), "Must be in range 0 - 5 inclusive."));
            }
            if (maxPlayersOnTeam < 0 || maxPlayersOnTeam > 5)
            {
                throw (new ArgumentOutOfRangeException(nameof(maxPlayersOnTeam), "Must be in range 0 - 5 inclusive."));
            }
            if (minPlayersOnTeam > maxPlayersOnTeam)
            {
                throw (new ArgumentOutOfRangeException(nameof(minPlayersOnTeam),
                                                       "Must not be greater than maxPlayers"));
            }

            BotTeam          = team;
            Hero             = hero;
            Difficulty       = difficulty;
            Rule             = rule;
            MinPlayersOnTeam = minPlayersOnTeam;
            MaxPlayersOnTeam = maxPlayersOnTeam;
        }
Пример #3
0
 private bool GetRuleIsFollowed(IBotRule rule, Team team)
 {
     return(rule.FollowsRule(team, _slots));
 }
Пример #4
0
 public void RequestBot(AiHero hero, Difficulty difficulty, IBotRule rule, int minPlayersOnTeam,
                        int maxPlayersOnTeam)
 {
     RequestBot(Team.Blue, hero, difficulty, rule, minPlayersOnTeam, maxPlayersOnTeam);
     RequestBot(Team.Red, hero, difficulty, rule, minPlayersOnTeam, maxPlayersOnTeam);
 }
Пример #5
0
 public void RequestBot(Team team, AiHero hero, Difficulty difficulty, IBotRule rule)
 {
     RequestBot(team, hero, difficulty, rule, _defaultMinPlayersOnTeam, _defaultMaxPlayersOnTeam);
 }
Пример #6
0
 public void RequestBot(AiHero hero, Difficulty difficulty, IBotRule rule)
 {
     RequestBot(Team.Blue, hero, difficulty, rule);
     RequestBot(Team.Red, hero, difficulty, rule);
 }