Exemple #1
0
        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;
        }
Exemple #2
0
        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;
        }
Exemple #3
0
        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);
                    }
                }
            }
        }
Exemple #4
0
        private void ActionButton_Click(object sender, EventArgs e)
        {
            Figures tmp = (Figures)mainTree.SelectedNode.Tag;

            tmp.flag = !tmp.flag;
        }