/// <summary> /// Constructor /// </summary> /// <param name="level">level data</param> /// <param name="x">horizontal coordinate of selected tile</param> /// <param name="y">vertical coordinate of selected tile</param> public GameTowerSelection(Level level, int x, int y) { InitializeComponent(); // Set fields this.level = level; this.x = x; this.y = y; // Draw the cursor cursor = ControlManager.CreateCanvas(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\TowerHaven\\Marker", 8, 6, 8); nameGrid.Children.Add(cursor); // Find buildable towers that are affordable towers = level.GetBuildableTowers(); int index = 0; foreach (Tower t in towers) { AddLabel(25, index, t.name, nameGrid); AddLabel(6, index, t.buildCost.ToString(), costGrid); AddLabel(6, index, t.range.ToString(), rangeGrid); AddLabel(6, index, t.damage.ToString(), damageGrid); AddLabel(6, index, t.status, statusGrid); index += 16; } }