void Map::set(const Point& point, int value) { int pointRow = convertYToRow(point.getY()); int pointColumn = convertXToColumn(point.getX()); set(pointRow, pointColumn, value); }
char rectanglePrint(int column, int line, int x, int y, int width, int height, char c) { int xColumn = convertXToColumn(x); int yLine = convertYToLine(y); if (abs(column - xColumn) <= width && abs(line - yLine) <= height) { return c; } return CHAR_NO_DRAW; }
char circlePrint(int column, int line, int x, int y, int radius, char c) { int xColumn = convertXToColumn(x); int yLine = convertYToLine(y); if ((column - xColumn) * (column - xColumn) + (line - yLine) * (line - yLine) <= radius * radius) { return c; } return CHAR_NO_DRAW; }
char pointPrint(int column, int line, int x, int y, char c) { int xColumn = convertXToColumn(x); int yLine = convertYToLine(y); if (column == xColumn && line == yLine) { return c; } return CHAR_NO_DRAW; }
bool Map::isMismatch(const Point& point, int value, bool & isUnknown) { // Convert x and y to row and column int pointRow = convertYToRow(point.getY()); int pointColumn = convertXToColumn(point.getX()); return isMismatch(pointRow, pointColumn, value, isUnknown); }
void Map::set(double x, double y, int value) { // TODO: input checks // Convert x and y to row and column int row = convertYToRow(y); int column = convertXToColumn(x); set(row, column, value); }
int Map::get(double x, double y) const { // TODO: input checks // Convert x and y to row and column int row = convertYToRow(y); int column = convertXToColumn(x); return get(row, column); }