#include "Tile.h" Tile::Tile():colour(EMPTY),shape(ZERO) { } Tile::Tile(Colour colour, Shape shape):colour(colour),shape(shape) { } bool Tile::isEmpty() { bool res = false; if(colour == EMPTY && shape == ZERO) { res = true; } return res; } bool Tile::isValidPlacement(Tile currentTile, Tile adjacentTile) { // Check if either tile is empty if (currentTile.isEmpty() || adjacentTile.isEmpty()) { return false; } // Check if the colours match if (currentTile.colour == adjacentTile.colour) { return false; } // Check if the shapes match if (currentTile.shape != adjacentTile.shape) { return false; } return true; }
def add(a, b): return a + b