22 lines
491 B
C++
22 lines
491 B
C++
#include "display.h"
|
|
|
|
display::display(): contents{DISPLAY_HEIGHT} {}
|
|
|
|
void display::clear() {
|
|
for (auto line : contents)
|
|
line.clear();
|
|
}
|
|
|
|
void display::print(std::ostream &out) const {
|
|
for (auto line : contents)
|
|
out << line;
|
|
}
|
|
|
|
void display::print_line(const std::string &line, const int linenum) {
|
|
contents[linenum] = line;
|
|
}
|
|
|
|
void display::print_position(const position &pos, const char ch) {
|
|
contents[pos.y][pos.x] = ch;
|
|
}
|