added rlutil.h

This commit is contained in:
2019-11-05 23:02:16 -07:00
parent 41c1116d22
commit 9204af78c9
109 changed files with 4146 additions and 532 deletions

View File

@@ -5,20 +5,26 @@
#ifndef CS3460_CPP_LIFESIMULATOR_HPP
#define CS3460_CPP_LIFESIMULATOR_HPP
#include <cstdint>
#include "Pattern.hpp"
class LifeSimulator
{
public:
private:
std::uint8_t sizeX;
std::uint8_t sizeY;
std::vector<std::vector<bool>> nextScreen;
std::vector<std::vector<bool>> currentScreen;
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;
std::uint8_t getSizeX() const { return sizeX; };
std::uint8_t getSizeY() const { return sizeY; };
bool getCell(std::uint8_t x, std::uint8_t y) const { return currentScreen[y + 1][x + 1]; };
;
};
#endif //CS3460_CPP_LIFESIMULATOR_HPP