Exemplo n.º 1
0
        void mapControl1_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left)
            {
                return;
            }
            MapHitInfo         hitInfo     = MapControl.CalcHitInfo(e.Location);
            MapOverlayItemBase clickedItem = MapOverlayUtils.GetClickedOverlayItem(hitInfo);

            if (clickedItem == null)
            {
                return;
            }
            ClickedAction action = OverlayManager.GetClickedAction(clickedItem);

            switch (action)
            {
            case ClickedAction.NewGame:
                MapInteractiveEnabling(false);
                OverlayManager.ShowNewGameOverlay();
                break;

            case ClickedAction.StartGame:
                GameInit(OverlayManager.GetSelectedLevel());
                break;

            case ClickedAction.FinishGame:
                this.gameCore.FinishGame();
                break;

            case ClickedAction.ShowCountry:
                this.gameCore.ShowCountry();
                break;

            case ClickedAction.SkipCountry:
                this.gameCore.SkipCountry();
                break;
            }
        }