示例#1
0
文件: Draft.cs 项目: longde123/grove
        private List <DraftPlayer> CreatePlayers(int playerCount, CardRatings ratings, bool includeHumanPlayer)
        {
            var aiStrategies = new Func <IDraftingStrategy>[]
            {
                () => new Forcing(ratings),
                () => new Greedy(ratings),
            };

            var players = new List <DraftPlayer>();

            for (var i = 0; i < playerCount; i++)
            {
                players.Add(new DraftPlayer
                {
                    Strategy = aiStrategies[RandomEx.Next(10) >= 3 ? 0 : 1]()
                });
            }

            if (includeHumanPlayer)
            {
                players[0] = new DraftPlayer
                {
                    Strategy = _userInterface
                };
            }


            return(players);
        }
示例#2
0
        private List<DraftPlayer> CreatePlayers(int playerCount, CardRatings ratings, bool includeHumanPlayer)
        {
            var aiStrategies = new Func<IDraftingStrategy>[]
            {
              () => new Forcing(ratings),
              () => new Greedy(ratings),
            };

              var players = new List<DraftPlayer>();

              for (var i = 0; i < playerCount; i++)
              {
            players.Add(new DraftPlayer
              {
            Strategy = aiStrategies[RandomEx.Next(10) >= 3 ? 0 : 1]()
              });
              }

              if (includeHumanPlayer)
              {
            players[0] = new DraftPlayer
              {
            Strategy = _userInterface
              };
              }

              return players;
        }