Exemple #1
0
    public RemoveLineData[] GetEnableRemoveLine(int blockIndex, int posiX, int posiY)
    {
        mapManager.TileAddMap(blockManager.GetBlockByNumber(blockIndex).tile, posiX, posiY);

        int minX, maxX, minY, maxY;

        GetBlocksMinAndMax(blockManager.GetBlockByNumber(blockIndex).tile, posiX, posiY, out minX, out maxX, out minY, out maxY);

        for (int i = 0, count = m_array_removeLine.Length; i < count; i++)
        {
            m_array_removeLine[i] = new RemoveLineData(false);
        }

        int index = 0;

        for (int x = minX; x <= maxX; x++)
        {
            if (IsLineFull(LINE_DIRECTION.VERTICAL, x))
            {
                RemoveLineData removeData = new RemoveLineData(LINE_DIRECTION.VERTICAL, x, true);
                m_array_removeLine[index] = new RemoveLineData(removeData);
                index++;
            }
        }

        for (int y = minY; y <= maxY; y++)
        {
            if (IsLineFull(LINE_DIRECTION.HORIZONTAL, y))
            {
                RemoveLineData removeData = new RemoveLineData(LINE_DIRECTION.HORIZONTAL, y, true);
                m_array_removeLine[index] = new RemoveLineData(removeData);
                index++;
            }
        }

        mapManager.RemoveTile(blockManager.GetBlockByNumber(blockIndex).tile, posiX, posiY);

        return(m_array_removeLine);
    }
Exemple #2
0
    public RemoveLineData[] GetRemoveLine(TableTile[] tiles, int posiX, int posiY)
    {
        int minX, maxX, minY, maxY;

        GetBlocksMinAndMax(tiles, posiX, posiY, out minX, out maxX, out minY, out maxY);

        for (int i = 0, count = m_array_removeLine.Length; i < count; i++)
        {
            m_array_removeLine[i] = new RemoveLineData(false);
        }

        int index = 0;

        for (int x = minX; x <= maxX; x++)
        {
            if (IsLineFull(LINE_DIRECTION.VERTICAL, x))
            {
                RemoveLineData removeData = new RemoveLineData(LINE_DIRECTION.VERTICAL, x, true);
                m_array_removeLine[index] = new RemoveLineData(removeData);
                index++;
            }
        }

        for (int y = minY; y <= maxY; y++)
        {
            if (IsLineFull(LINE_DIRECTION.HORIZONTAL, y))
            {
                RemoveLineData removeData = new RemoveLineData(LINE_DIRECTION.HORIZONTAL, y, true);
                m_array_removeLine[index] = new RemoveLineData(removeData);
                index++;
            }
        }

        RemoveLine(m_array_removeLine);

        return(m_array_removeLine);
    }