diff --git a/Hw6/.idea/.gitignore b/Hw6/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/Hw6/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/Hw6/.idea/Hw6.iml b/Hw6/.idea/Hw6.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/Hw6/.idea/Hw6.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Hw6/.idea/misc.xml b/Hw6/.idea/misc.xml new file mode 100644 index 0000000..79b3c94 --- /dev/null +++ b/Hw6/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Hw6/.idea/modules.xml b/Hw6/.idea/modules.xml new file mode 100644 index 0000000..1a0784b --- /dev/null +++ b/Hw6/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Hw6/.idea/vcs.xml b/Hw6/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/Hw6/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Hw6/LifeSimulator.cpp b/Hw6/LifeSimulator.cpp index 56e5bd0..54d183f 100644 --- a/Hw6/LifeSimulator.cpp +++ b/Hw6/LifeSimulator.cpp @@ -1,4 +1,9 @@ // // Created by Brady Bodily on 11/5/19. // +#include "LifeSimulator.hpp" +LifeSimulator::LifeSimulator(std::uint8_t sizeX, std::uint8_t sizeY) : +sizeX(sizeX), sizeY(sizeY) { + +} \ No newline at end of file diff --git a/Hw6/LifeSimulator.hpp b/Hw6/LifeSimulator.hpp index 9b00fc7..6fc4ed0 100644 --- a/Hw6/LifeSimulator.hpp +++ b/Hw6/LifeSimulator.hpp @@ -5,4 +5,20 @@ #ifndef CS3460_CPP_LIFESIMULATOR_HPP #define CS3460_CPP_LIFESIMULATOR_HPP +#include +#include "Pattern.hpp" + +class LifeSimulator +{ +public: + LifeSimulator(std::uint8_t sizeX, std::uint8_t sizeY); + + void insertPattern(const Pattern& pattern, std::uint8_t startX, std::uint8_t startY); + void update(); + + std::uint8_t getSizeX() const; + std::uint8_t getSizeY() const; + bool getCell(std::uint8_t x, std::uint8_t y) const; +}; + #endif //CS3460_CPP_LIFESIMULATOR_HPP diff --git a/Hw6/Pattern.hpp b/Hw6/Pattern.hpp index bd65770..546595a 100644 --- a/Hw6/Pattern.hpp +++ b/Hw6/Pattern.hpp @@ -5,4 +5,14 @@ #ifndef CS3460_CPP_PATTERN_HPP #define CS3460_CPP_PATTERN_HPP +#include + +class Pattern +{ +public: + virtual std::uint8_t getSizeX() const = 0; + virtual std::uint8_t getSizeY() const = 0; + virtual bool getCell(std::uint8_t x, std::uint8_t y) const = 0; +}; + #endif //CS3460_CPP_PATTERN_HPP diff --git a/Hw6/PatternGlider.cpp b/Hw6/PatternGlider.cpp index f42abcb..caa30c7 100644 --- a/Hw6/PatternGlider.cpp +++ b/Hw6/PatternGlider.cpp @@ -3,3 +3,13 @@ // #include "PatternGlider.hpp" + +PatternGlider::PatternGlider() : X(5), Y(5) +{ + cells[3][1]; + cells[3][2]; + cells[3][3]; + cells[2][3]; + cells[1][2]; + +} \ No newline at end of file diff --git a/Hw6/PatternGlider.hpp b/Hw6/PatternGlider.hpp index cfee49c..cc59b4a 100644 --- a/Hw6/PatternGlider.hpp +++ b/Hw6/PatternGlider.hpp @@ -5,4 +5,28 @@ #ifndef CS3460_CPP_PATTERNGLIDER_HPP #define CS3460_CPP_PATTERNGLIDER_HPP +#include +#include "Pattern.hpp" + +class PatternGlider : public Pattern +{ +private: + int X; + int Y; + std::array, 5> cells; +public: + PatternGlider(); + int getSizeX() + { + return X; + }; + int getSizeY(){ + return Y; + }; + bool getCell(int x, int y){ + return cells[x][y]; + }; + +}; + #endif //CS3460_CPP_PATTERNGLIDER_HPP diff --git a/Hw6/Renderer.hpp b/Hw6/Renderer.hpp index 7fc52aa..cea847a 100644 --- a/Hw6/Renderer.hpp +++ b/Hw6/Renderer.hpp @@ -5,4 +5,12 @@ #ifndef HW6_RENDER_HPP #define HW6_RENDER_HPP +#include "LifeSimulator.hpp" + +class Renderer +{ +public: + virtual void render(const LifeSimulator& simulation) = 0; +}; + #endif //HW6_RENDER_HPP diff --git a/Hw6/main.cpp b/Hw6/main.cpp index 56e5bd0..5db58b0 100644 --- a/Hw6/main.cpp +++ b/Hw6/main.cpp @@ -2,3 +2,7 @@ // Created by Brady Bodily on 11/5/19. // +int main(){ + + return 0; +} \ No newline at end of file