Beispiel #1
0
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);
            int z = Control.MousePosition.X;

            int   x = ConvertIntToGrid(MousePosition.X);
            int   y = ConvertIntToGrid(MousePosition.Y);
            Point p = new Point(x, y);

            DeselectAll();
            if (!entities.ContainsKey(p))
            {
                TryToMoveTo(p);
            }
            else
            {
                Entity ent = entities[p];
                ent.ClickOn();
            }

            selected = p;
            Refresh();
            if (TurnOver())
            {
                EndPlayerTurn();
            }
        }