#pragma once #include #include "flecs.h" #include "Components/Misc.hpp" #include "Util/Span.h" struct Support { uint8_t MaxSupport{}; uint8_t SupportsAvailable{}; }; struct GroundedSupport {}; struct RequiresSupport {}; flecs::entity GetSupport(flecs::world& world, Vector2 pos); void RecalculateSupport(flecs::world& world, tcb::span skip = {}, tcb::span unground = {}); bool CanRemove(flecs::world& world, tcb::span positions); void Flecs_Support(flecs::world& world); inline void Support_Helper(const flecs::entity& entity, Vector2 pos, uint8_t maxSupport, bool grounded = false) { entity.set({ pos }); if (grounded) entity.add(); // before set so OnAdd fires with grounded state visible entity.set({ maxSupport }); }