Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public Game Build()
        {
            var map = MapStrategy.BuildMap();

            Race[] races = { new Centaur(), new Cerberus(), new Cyclops() };
            Shuffle(races);

            var numberPlayers    = playerNames.Count;
            var initialPositions = new PositionGenerator().GenerateRandomPositions(numberPlayers, map.Size);

            Shuffle(initialPositions);

            var players = new Player[numberPlayers];

            for (var i = 0; i < players.Length; i++)
            {
                players[i] = new Player(playerNames[i], races[i], MapStrategy.NumberUnits, initialPositions[i]);
            }
            Shuffle(players);

            return(new Game(map, MapStrategy.MaximumNumberTurns, players));
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mapStrategy"></param>
        /// <returns></returns>
        public NewGameBuilder SetMap(MapStrategy mapStrategy)
        {
            MapStrategy = mapStrategy;

            return(this);
        }