示例#1
0
        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();
            }
        }
示例#2
0
 void tsp_CityCreated(object sender, NewCityEventArgs e)
 {
     _bufferPoint.Add(new Point(e.NewCity.getx(), e.NewCity.gety()));
     pnlMap.Refresh();
 }