SpatialMap now uses unordered_multimap to allow for multiple items in a square, but they're also tagged to mark some with collision.
This commit is contained in:
parent
b193bab148
commit
f26189c696
6 changed files with 60 additions and 51 deletions
|
@ -14,6 +14,8 @@ namespace DinkyECS
|
|||
{
|
||||
using Entity = unsigned long;
|
||||
|
||||
const Entity NONE = 0;
|
||||
|
||||
using EntityMap = std::unordered_map<Entity, size_t>;
|
||||
|
||||
template <typename T>
|
||||
|
@ -30,7 +32,7 @@ namespace DinkyECS
|
|||
typedef std::queue<Event> EventQueue;
|
||||
|
||||
struct World {
|
||||
unsigned long entity_count = 0;
|
||||
unsigned long entity_count = NONE+1;
|
||||
std::unordered_map<std::type_index, EntityMap> $components;
|
||||
std::unordered_map<std::type_index, std::any> $facts;
|
||||
std::unordered_map<std::type_index, EventQueue> $events;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue