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:
18  explicit StringScreen(int width, int height);
20  char charAt(int col, int row) const;
26  void charAtPut(int col, int row, char value);
29  void clear();
37  std::string toString() const;
38 
39 private:
40  std::vector<std::vector<char>> buffer_;
41 };
Represents the abstract notion of a character-addressable writable screen.
Definition: screen.h:4
int width() const
Definition: screen.cpp:31
int height() const
Definition: screen.cpp:33
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.