summaryrefslogtreecommitdiff
path: root/Homework/cs3460/gameoflife/PatternSet.hpp
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-07-02 11:55:17 -0700
commit6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6 (patch)
treeed97e39ec77c5231ffd2c394493e68d00ddac5a4 /Homework/cs3460/gameoflife/PatternSet.hpp
downloadmisc-undergrad-6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6.tar.gz
misc-undergrad-6bf4b90c90f15f4ab60833bddf5b5756d1a6b1f6.zip
Diffstat (limited to 'Homework/cs3460/gameoflife/PatternSet.hpp')
-rw-r--r--Homework/cs3460/gameoflife/PatternSet.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/Homework/cs3460/gameoflife/PatternSet.hpp b/Homework/cs3460/gameoflife/PatternSet.hpp
new file mode 100644
index 0000000..9fae200
--- /dev/null
+++ b/Homework/cs3460/gameoflife/PatternSet.hpp
@@ -0,0 +1,25 @@
+#include "Pattern.hpp"
+
+#include <algorithm>
+#include <cstdint>
+#include <set>
+
+#ifndef PATTERN_SET_HPP
+ #define PATTERN_SET_HPP
+
+class PatternSet : public Pattern
+{
+ protected:
+ std::set<std::pair<std::uint8_t, std::uint8_t>> m_aliveCells;
+ std::uint8_t m_width;
+ std::uint8_t m_height;
+
+ public:
+ PatternSet(std::uint8_t width, std::uint8_t height);
+ PatternSet(const std::set<std::pair<std::uint8_t, std::uint8_t>> aliveCells);
+ virtual std::uint8_t getSizeX() const;
+ virtual std::uint8_t getSizeY() const;
+ virtual bool getCell(std::uint8_t x, std::uint8_t y) const;
+};
+
+#endif // PATTERN_SET_HPP