private void ActiveCell_MouseLeftButtonUp(object sender, MouseEventArgs e) { foreach (UIElement ue in MapCanvas.Children) { if (ue is LandCell) { LandCell lc = (LandCell)ue; if (lc.Clicked) { GunCell gc = new GunCell(lc.X, lc.Y); MapCanvas.Children.Add(gc); _map.AddGunCell(gc); MapCanvas.Children.Remove(ue); break; } } } }
public void AddGunCell(GunCell gc) { _gunCells.Add(gc); }