Exemplo n.º 1
0
        private void BuildStation(Player player)
        {
            var stationSelection = player.SelectStation();

            UsedCards.AddRange(stationSelection.Cards);
            player.Cards.RemoveAll(c => stationSelection.Cards.Contains(c));

            MapCities.Single(c => c.City.Id == stationSelection.StationId).Owner = player;
        }
Exemplo n.º 2
0
        private void GetDataFromDb()
        {
            Connections = DbManager.GetConnections();

            Connections.ForEach(connection =>
            {
                MapConnections.Add(new MapConnection(connection));
            });
            var cities = DbManager.GetCities();

            cities.ForEach(city =>
            {
                MapCities.Add(new MapCity(city));
            });
            Routes = DbManager.GetRoutes();
        }
Exemplo n.º 3
0
        private void BuildStation(int objectId, List <Card> cardsForPayment, Player player)
        {
            var city = MapCities.Single(c => c.City.Id == objectId);

            if (city.Owner == null)
            {
                city.Owner = player;
                foreach (var card in cardsForPayment)
                {
                    player.Cards.Remove(card);
                }
            }
            else
            {
                throw new ArgumentException("This city is already occupated");
            }
        }