Exemplo n.º 1
0
        public void DestroyByFlood()
        {
            var cityBackground = new CityBackground(GetArea());

            while (true)
            {
                cityBackground.FloodedWherePossible(Walls);
                var walls = cityBackground.FindAllFloodedWalls(Walls);
                if (walls.IsEmpty())
                {
                    return;
                }
                var cycleWalls = new GraphCylceSeacher(walls).FindAllCycleWalls();
                if (cycleWalls.IsEmpty())
                {
                    return;
                }
                cycleWalls.ForEach(w => Walls.Remove(w));
            }
        }
 public CellCityBackground(CityBackground owner, Int32 x, Int32 y)
 {
     coordinate = new Point(x, y);
     ownerCity  = owner;
     IsFlooded  = false;
 }