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:
Zed A. Shaw 2025-07-31 13:00:39 -04:00
parent b193bab148
commit f26189c696
6 changed files with 60 additions and 51 deletions

View file

@ -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;