#include "pch.h" #include "Puzzle.h" Cell Puzzle::GetCell(int x, int y) const { x = Mod(x); if (!SafeCell(x, y)) return Cell::Undefined(); return grid[x][y]; } Cell::Color Puzzle::GetLine(int x, int y) const { return grid[x][y].color; } void Puzzle::NewGrid(int newWidth, int newHeight) { if (newWidth == 0) { assert(false); newWidth = width; newHeight = height; } else { // @Cleanup! This should be in the ctor... width = 2*newWidth + 1; height = 2*newHeight + 1; } grid.clear(); grid.resize(width); for (int x=0; x= width) return false; if (y < 0 || y >= height) return false; return true; }