Fishtank
shape.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
7 class Shape {
8 public:
11  explicit Shape(std::vector<std::string> shape);
13  int width() const;
15  int height() const;
21  char charAt(int col, int row) const;
22 
23 private:
24  std::vector<std::string> shape_;
25 };
Represents an ASCII-art drawing and its corresponding bounding box.
Definition: shape.h:7
Shape(std::vector< std::string > shape)
Take in an array of lines and right-pad the shorter ones with ' ' to the width of the longest line.
Definition: shape.cpp:9
char charAt(int col, int row) const
Fetch the character at the given coordinate pair.
Definition: shape.cpp:33
int width() const
Definition: shape.cpp:29
int height() const
Definition: shape.cpp:31