|
|
|
@ -2,12 +2,16 @@ |
|
|
|
|
#include "dinkyecs.hpp" |
|
|
|
|
#include <iostream> |
|
|
|
|
#include <fmt/core.h> |
|
|
|
|
#include "point.hpp" |
|
|
|
|
|
|
|
|
|
using namespace fmt; |
|
|
|
|
using DinkyECS::Entity; |
|
|
|
|
using std::string; |
|
|
|
|
|
|
|
|
|
struct Point { |
|
|
|
|
size_t x; |
|
|
|
|
size_t y; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
struct Player { |
|
|
|
|
string name; |
|
|
|
|
Entity eid; |
|
|
|
@ -17,35 +21,24 @@ struct Position { |
|
|
|
|
Point location; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// DINKY_HAS_COMPONENT(Point, x, y);
|
|
|
|
|
// DINKY_HAS_COMPONENT(Position, location);
|
|
|
|
|
|
|
|
|
|
struct Motion { |
|
|
|
|
int dx; |
|
|
|
|
int dy; |
|
|
|
|
bool random=false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// DINKY_HAS_COMPONENT(Motion, dx, dy, random);
|
|
|
|
|
|
|
|
|
|
struct Velocity { |
|
|
|
|
double x, y; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// DINKY_HAS_COMPONENT(Velocity, x, y);
|
|
|
|
|
|
|
|
|
|
struct Gravity { |
|
|
|
|
double level; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// DINKY_HAS_COMPONENT(Gravity, level);
|
|
|
|
|
|
|
|
|
|
struct DaGUI { |
|
|
|
|
int event; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// DINKY_HAS_COMPONENT(DaGUI, event);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Using a function catches instances where I'm not copying |
|
|
|
|
* the data into the world. |
|
|
|
|