예제 #1
0
    bool CheckPrecondition(eFindMode mode, TileCell nextTileCell, TileCell targetTileCell)
    {
        //if ((null != nextTileCell) && (true == nextTileCell.IsPathfindable() && false == nextTileCell.IsVisit() ||
        //    (nextTileCell.GetTileX() == _targetTileCell.GetTileX() && nextTileCell.GetTileY() == _targetTileCell.GetTileY())))
        //    return true;

        bool condition = false;

        if (false == nextTileCell.IsVisit())
        {
            condition = true;
        }

        if (eFindMode.VIEW_MOVERANGE == mode || eFindMode.FIND_PATH == mode)
        {
            if (condition)
            {
                condition = nextTileCell.CanMove();
            }
        }

        if (eMapType.DUNGEON == GameManager.Instance.GetMapType())
        {
            return(condition);
        }
        else if (eMapType.TOWN == GameManager.Instance.GetMapType())
        {
            //해당 타일이 목표 타일
            if (nextTileCell.GetTileX() == targetTileCell.GetTileX() && nextTileCell.GetTileY() == targetTileCell.GetTileY())
            {
                condition = true;
            }
        }
        return(condition);
    }
예제 #2
0
    //Move
    public bool CanMoveTile(int tileX, int tileY)
    {
        if (tileX < 0 || _width <= tileX)
        {
            return(false);
        }
        if (tileY < 0 || _height <= tileY)
        {
            return(false);
        }

        TileCell tileCell = GetTileCell(tileX, tileY);

        return(tileCell.CanMove());
    }