void CityManagerCityAdded(object sender, NewCityEventArgs e) { if (!e.IsNew) { return; } var city = (ICity)sender; foreach (var stronghold in strongholds.Values.Where(s => s.StrongholdState == StrongholdState.Inactive && tileLocator.TileDistance(s.PrimaryPosition, s.Size, city.PrimaryPosition, 1) < Config.stronghold_radius_base + Config.stronghold_radius_per_level * s.Lvl)) { stronghold.BeginUpdate(); ++stronghold.NearbyCitiesCount; stronghold.EndUpdate(); } }
void tsp_CityCreated(object sender, NewCityEventArgs e) { _bufferPoint.Add(new Point(e.NewCity.getx(), e.NewCity.gety())); pnlMap.Refresh(); }