Esempio n. 1
0
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;
}
Esempio n. 5
0
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);
}
Esempio n. 6
0
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);
}
Esempio n. 7
0
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);
}