private bool FitsLeft(Tile other, SideHash[] otherHashes) { SideHash sideHash = GetHashForSide(Sides.Left); for (int i = 0; i < otherHashes.Length; i++) { SideHash otherHash = otherHashes[i]; if (sideHash.Match(otherHash, out bool flip)) { this.SetTile(Sides.Left, other.Id); other.SetTile(Sides.Right, this.Id); other.RotateAndFlip((2 - i), false, flip); return(true); } } return(false); }
private bool FitsBottom(Tile other, SideHash[] otherHashes) { SideHash sideHash = GetHashForSide(Sides.Bottom); for (int i = 0; i < otherHashes.Length; i++) { SideHash otherHash = otherHashes[i]; if (sideHash.Match(otherHash, out bool flip)) { this.SetTile(Sides.Bottom, other.Id); other.SetTile(Sides.Top, this.Id); other.RotateAndFlip((1 - i), flip, false); return(true); } } return(false); }