Ejemplo n.º 1
0
        bool CompareColorInPattern(MatchData.Direction dir, int x, int y, Colors color)
        {
            switch (dir)
            {
                case MatchData.Direction.LEFT:
                    return (CompareColor(color, x - 2, y) && CompareColor(color, x - 1, y));
                case MatchData.Direction.RIGHT:
                    return (CompareColor(color, x + 2, y) && CompareColor(color, x + 1, y));
                case MatchData.Direction.TOP:
                    return (CompareColor(color, x, y + 2) && CompareColor(color, x, y + 1));
                case MatchData.Direction.BOTTOM:
                    return (CompareColor(color, x, y - 2) && CompareColor(color, x, y - 1));
            }

            return false;
        }
Ejemplo n.º 2
0
        bool CompareColorInPattern(MatchData.Direction dir, Block block)
        {
            int x = block._X;
            int y = block._Y;
            Colors color = block.CurrentColor;

            switch (dir)
            {
                case MatchData.Direction.LEFT:
                    return (CompareColor(color, x - 2, y) && CompareColor(color, x - 1, y));
                case MatchData.Direction.RIGHT:
                    return (CompareColor(color, x + 2, y) && CompareColor(color, x + 1, y));
                case MatchData.Direction.TOP:
                    return (CompareColor(color, x, y + 2) && CompareColor(color, x, y + 1));
                case MatchData.Direction.BOTTOM:
                    return (CompareColor(color, x, y - 2) && CompareColor(color, x, y - 1));
            }

            return false;
        }