예제 #1
0
    public bool IsSameColor(SelectionPoint selectionPoint)
    {
        var tiles      = GetTiles();
        var otherTiles = selectionPoint.GetTiles();

        return(IsColorMatching() && selectionPoint.IsColorMatching() && tiles[0].tileColor == otherTiles[0].tileColor);
    }
예제 #2
0
    public bool IsAdjacent(SelectionPoint selectionPoint)
    {
        var            tiles      = GetTiles();
        var            otherTiles = selectionPoint.GetTiles();
        HashSet <Tile> totalTiles = new HashSet <Tile>();

        for (int i = 0; i < 3; i++)
        {
            totalTiles.Add(tiles[i]);
            totalTiles.Add(otherTiles[i]);
            if (totalTiles.Count != 2 * (i + 1))
            {
                return(true);
            }
        }

        return(false);
    }