Exemplo n.º 1
0
        public void ExecuteGameAction(GameAction action)
        {
            Debug.Log(action.Text);
            switch (action.ActionType)
            {
            case GameActionTypes.ContinueRoad:
                ContinueRoad(SelectedToon, action);
                break;

            case GameActionTypes.MoveThere:
                ScheduleMovementForToon(SelectedToon, action);
                break;

            case GameActionTypes.MineRock:
                ScheduleMovementForNeerRockPosition(SelectedToon, action);
                break;

            case GameActionTypes.PullKing:
                ScheduleMovementToPullKing(SelectedToon, action);
                break;

            default:
                break;
            }
            HudService.CloseMenu();
        }
Exemplo n.º 2
0
        public void SelectPosition(int x, int z)
        {
            if (MapService.HasToonAt(x, z))
            {
                SelectedToon = MapService.GetToonAt(x, z);
            }
            else if (SelectedToon != null)
            {
                CubeTypes type    = MapService.GetCubeType(x, z);
                var       actions = ActionService.GetActionsForCube(type, x, z);

                if (actions.Where(a => a.ActionType != GameActionTypes.Cancel).Any())
                {
                    HudService.UpdateMenuActions(actions);
                    HudService.OpenMenu();
                }
            }
        }