restructure and add server/client example
This commit is contained in:
48
shared/inc/values/DnaManager.hpp
Normal file
48
shared/inc/values/DnaManager.hpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include "values/Dna.hpp"
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
#define NUM_PER_GEN 10
|
||||
#define NUM_OF_MUT 1
|
||||
|
||||
enum Liked
|
||||
{
|
||||
tbd,
|
||||
yes,
|
||||
no
|
||||
};
|
||||
|
||||
struct UiUnit
|
||||
{
|
||||
Dna *dna;
|
||||
Liked liked;
|
||||
int index;
|
||||
};
|
||||
|
||||
struct NetUnit
|
||||
{
|
||||
uint32_t hash;
|
||||
uint32_t index;
|
||||
Liked liked;
|
||||
};
|
||||
|
||||
static_assert(12 == sizeof(NetUnit));
|
||||
|
||||
struct DnaManagerData
|
||||
{
|
||||
int generation;
|
||||
uint128 randSeed;
|
||||
uint128 id;
|
||||
int queued;
|
||||
int showed;
|
||||
std::vector<Dna> vector;
|
||||
std::vector<int> liked;
|
||||
std::vector<int> disliked;
|
||||
};
|
||||
|
||||
namespace DnaManager
|
||||
{
|
||||
UiUnit next(DnaManagerData *data);
|
||||
bool like(UiUnit unit, DnaManagerData *data);
|
||||
void newGen(DnaManagerData *data);
|
||||
};
|
Reference in New Issue
Block a user