public override void clickCoordinate(int x, int y)
    {
        bool pathconfirming = false;

        if (PlayMap.LockMovement)
        {
            TileSelect tile = PlayMap.Grid.getTileSpec(x, y);
            if (tile.HighLightColorType == TileSelect.HighlightType.EnemyTargetable || tile.HighLightColorType == TileSelect.HighlightType.EnemyRTargetable)
            {
                if (selectTileX == x && selectTileY == y)
                {
                    confirmAttack();
                }
                else
                {
                    var      unit     = UnitPlacement [selectUnitX, selectUnitY];
                    GameUnit unitStat = (GameUnit)unit.GetComponent("GameUnit");
                    UnitBattleController = UnitControlBattle.CalculateBattle(unitStat, targetTileX, targetTileY, x, y);
                    PlayMap.ShowAttackInfo(x, y);
                }
            }
            else
            {
                PlayMap.HideAttackInfo();
            }
            selectTileX = x;
            selectTileY = y;
        }
        else if (UnitPlacement [x, y] != null)
        {
            //Set tile selection
            TileSelect tile = PlayMap.Grid.getTileSpec(x, y);

            if (selectUnitX >= 0 &&                                                  // there is a unit already selected
                tile.HighLightColorType == TileSelect.HighlightType.EnemyTargetable) // selecting enemy target for direct combat

//				Debug.Log("ENGAGE!");
            //Second choosing of the same tile
            {
                if (selectTileX == x && selectTileY == y && confirmPath && UnitMovementController.getRouteSize() > 0)
                {
                    confirmMovement();
                }
                else
                {
                    GameUnit unit = (GameUnit)UnitPlacement[selectUnitX, selectUnitY].GetComponent("GameUnit");
                    if (!unit.HasMoved)
                    {
                        pathconfirming = UnitMovementController.attackSelect(x, y, unit);
                    }
                }
                selectTileX = x;
                selectTileY = y;
            }
            else if (tile.HighLightColorType == TileSelect.HighlightType.EnemyRTargetable)              // selecting indirect combat
//				Debug.Log("BOMBARD!");
            {
                selectTileX = x;
                selectTileY = y;
            }
            else
            {
                selectTileX = x;
                selectTileY = y;

                if (selectUnitX == x && selectUnitY == y)                  //Same unit
                {
                    confirmMovement();
                }
                else
                {
                    // a unit was selected

                    //				Debug.Log("ATTENTION!");

                    UnitMovementController.fullclear();

                    GameUnit unit = (GameUnit)UnitPlacement[selectTileX, selectTileY].GetComponent("GameUnit");
                    if (!unit.HasMoved)
                    {
                        selectUnitX = x;
                        selectUnitY = y;
                        UnitMovementController.mapMovement(x, y, unit);
                    }
                }
            }
        }
        else
        {
            if (selectUnitX >= 0)
            {
                //Second choosing of the same tile
                if (selectTileX == x && selectTileY == y && confirmPath && UnitMovementController.getRouteSize() > 0)
                {
                    confirmMovement();
                }
                else
                {
                    //Set tile selection
                    selectTileX = x;
                    selectTileY = y;

                    GameUnit unit = (GameUnit)UnitPlacement[selectUnitX, selectUnitY].GetComponent("GameUnit");
                    if (!unit.HasMoved)
                    {
                        pathconfirming = UnitMovementController.selectPath(x, y, unit);
                    }
                    if (!pathconfirming)                      // no valid selection
                    {
                        selectUnitX = selectTileX = -1;
                        selectUnitY = selectTileY = -1;

                        UnitMovementController.fullclear();
                    }
                }
            }
            else
            {
                //Set tile selection
                selectTileX = x;
                selectTileY = y;
            }
        }


        confirmPath = pathconfirming;

        if (selectTileX >= 0)
        {
            placeSelectHighlight(x, y);
        }
        else
        {
            removeSelectHighlight();
        }
    }