Пример #1
0
        private PlayerConfig CreatePlayerConfig(int id, IPlayer playerPCI, int playerCount)
        {
            PlayerConfig config = new PlayerConfig()
            {
                Id          = id,
                Lighthouses = this._lighthouses.Select(x => x.Position),
                Map         = this._map,
                PlayerCount = playerCount,
                Position    = GameLogic.GetRandomPlayablePosition(_map, _rand),
                PlayerDCI   = playerPCI
            };

            return(config);
        }
Пример #2
0
        private void SetupPlayers(IEnumerable <IPlayer> players)
        {
            List <ArenaPlayer> playerList = new List <ArenaPlayer>();

            int counter = 0;

            foreach (IPlayer player in players)
            {
                ArenaPlayer arenaPlayer = new ArenaPlayer(player.Name);

                PlayerConfig playerConfig = CreatePlayerConfig(counter, player, players.Count());

                arenaPlayer.Setup(playerConfig);
                arenaPlayer.PlayerDCI = playerConfig.PlayerDCI;

                player.Setup(playerConfig);

                playerList.Add(arenaPlayer);
                counter++;
            }

            this._players = playerList;
        }