private void MinusB_Click(object sender, EventArgs e) { Figures tmp = (Figures)mainTree.SelectedNode.Tag; //if (tmp.kickFlag) tmp.kickFlag = !tmp.kickFlag; tmp.OnKick -= Utils.MyBeep; }
private void PlusB_Click(object sender, EventArgs e) { Figures tmp = (Figures)mainTree.SelectedNode.Tag; if (!tmp.kickFlag) { tmp.kickFlag = !tmp.kickFlag; } tmp.OnKick += Utils.MyBeep; }
public void Kick(Figures selectedFig, List <Figures> actions) { foreach (Figures f in actions) { if (!f.Equals(selectedFig)) { Point othersFig = f.CountCenterCoordinates(); Point forSelectedFig = selectedFig.CountCenterCoordinates(); string result = Utils.CountDistanse(forSelectedFig, othersFig); if (result != null) { String s = selectedFig.Type + " collided with " + f.Type + " in coordinates : (" + result + '\n' + "----------------------------------------------"; OnKick?.Invoke(s); } } } }
private void ActionButton_Click(object sender, EventArgs e) { Figures tmp = (Figures)mainTree.SelectedNode.Tag; tmp.flag = !tmp.flag; }