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; }
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(); }
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"); } }