Start work on saving state of the manager

This commit is contained in:
2025-01-04 20:53:34 +01:00
parent ddb19902ee
commit adb0b2b5da
10 changed files with 47 additions and 37 deletions

View File

@@ -2,6 +2,7 @@
namespace sys
{
const char *transformFilePath(const char *filename);
size_t saveDataToFile(const char *filename, const char *data, size_t size);
size_t loadDataFromFile(const char *filename, char *data, size_t size);
bool fileExists(const char *filename);

View File

@@ -4,18 +4,12 @@
#include <cinttypes>
#include <array>
#include "values/mrand.hpp"
#define MAX_DEPTH 8
#define MAX_POSIBLE_DEPTH 11
static_assert(MAX_DEPTH <= MAX_POSIBLE_DEPTH);
struct uint128
{
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
};
struct Branch
{
uint8_t colorR;

View File

@@ -28,6 +28,7 @@ public:
private:
uint128 randSeed;
uint128 id;
std::vector<Dna> vector;
std::list<Dna *> queued;
std::list<Dna *> showed;

View File

@@ -1,11 +1,16 @@
#include <inttypes.h>
struct uint128;
struct uint128
{
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
};
namespace mrand
{
void setSeed(unsigned long long seed);
uint128 getState(unsigned long long seed);
float getFloat(uint128 *state);
int getValue(int min, int max, uint128 *state);
uint32_t getInt();
}