void setState()
    {
        // Sets the states of the current tile
        isBarrier = bManager.isBarrierSpawnPoint (tilePosition);
        valid = (SS.isNear (playerPosition, tilePosition) && iManager.hasMoveLeft ());
        // Check if the tile is in movement path
        if (tilePosition == playerPosition){
            current = true;
            chosen = true;
        }else{
            current=false;
            if(iManager.inMovement(tilePosition)){ // Mark the trail with mouseover color
                chosen = true;
            }else{
                chosen = false;
            }
        }

        if (iManager.inTarget (tilePosition)) {
            inTarget = true;
        } else {
            inTarget=false;
        }

        if (bManager.getTile (tilePosition).hasDamage()) {
            hasDamage = true;
        } else {
            hasDamage = false;
        }

        // If the player chose to stay here, s/he is in trouble
        if (current && bManager.isDangerous (tilePosition)) {
            // Let's unenable it for now because it gets in the way of our awesome menu
            dangerous = true;
        } else {
            dangerous = false;
        }

        if (iManager.isInTargetMode()) {
          int wpnId = iManager.getWeaponId();
          myPlayer = iManager.getMyPlayer();
          weapon wpn = myPlayer.getWeapon();
          if (!wpn.isInRange(SS.getDistance(tilePosition,playerPosition))
          	|| bManager.isBlocked(playerPosition,tilePosition)){
            isValidTarget = false;
          }else{
          	isValidTarget = true;
          }
        }
    }