Skip to content

Commit

Permalink
#32 Implemented drawing City Walls
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanWouters committed Feb 20, 2017
1 parent e887929 commit 3e7d9db
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Screens/CityView.cs
Expand Up @@ -168,6 +168,19 @@ public override bool MouseDown(ScreenEventArgs args)
{
picture.AddLayer(Resources.Instance.GetPart("CITYPIX2", 51, 151, 49, 49), 0, 72);
}

if (typeof(T) == typeof(CityWalls))
{
Picture wall = Resources.Instance.GetPart("CITYPIX2", 251, 101, 43, 49);
Picture door = Resources.Instance.GetPart("CITYPIX2", 51, 101, 49, 49);

//0, 108
for (int xx = 0; xx < 142; xx += 43)
picture.AddLayer(wall, xx, 108);
picture.AddLayer(door, 142, 108);
for (int xx = 191; xx < 320; xx += 43)
picture.AddLayer(wall, xx, 108);
}
}

public CityView(City city, bool founded = false, bool firstView = false, IProduction production = null)
Expand Down Expand Up @@ -206,6 +219,13 @@ public CityView(City city, bool founded = false, bool firstView = false, IProduc
DrawBuilding<Aqueduct>( _overlay);
}

if (city.Buildings.Any(b => b is CityWalls))
{
DrawBuilding<CityWalls>();
if (!(production is CityWalls))
DrawBuilding<CityWalls>( _overlay);
}

AddLayer(_background);

if (founded)
Expand Down

0 comments on commit 3e7d9db

Please sign in to comment.