Fishtank
string-screen.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "screen.h"
4 #include <string>
5 #include <vector>
6 
13 class StringScreen : public Screen {
14 public:
17  explicit StringScreen(int width, int height);
19  char charAt(int col, int row) const;
24  void charAtPut(int col, int row, char value);
27  void clear();
35  std::string toString() const;
36 
37 private:
38  std::vector<std::vector<char>> buffer_;
39 };
Represents the abstract notion of a character-addressable writable screen.
Definition: screen.h:4
int width() const
Definition: screen.cpp:17
int height() const
Definition: screen.cpp:19
Serializable implementation of Screen using a 2D character buffer.
Definition: string-screen.h:13
void charAtPut(int col, int row, char value)
std::string toString() const
StringScreen(int width, int height)
char charAt(int col, int row) const
Fetch the character at the given coordinate pair.