I think I've got my head around what ECS does and am slowly reshaping the engine to use it better.
This commit is contained in:
parent
da04c5ec54
commit
e42647d727
5 changed files with 93 additions and 76 deletions
28
components.hpp
Normal file
28
components.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
#include "dinkyecs.hpp"
|
||||
|
||||
struct Player {
|
||||
DinkyECS::Entity entity;
|
||||
};
|
||||
|
||||
struct Position {
|
||||
Point location;
|
||||
};
|
||||
|
||||
struct Motion {
|
||||
int dx;
|
||||
int dy;
|
||||
};
|
||||
|
||||
struct Combat {
|
||||
int hp;
|
||||
int damage;
|
||||
};
|
||||
|
||||
struct Treasure {
|
||||
int amount;
|
||||
};
|
||||
|
||||
struct Tile {
|
||||
std::string chr = "!";
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue