#pragma once #include "memory/memory.h" #include "entity.h" struct EntityArr { struct Entity *buffer; unsigned int capacity; unsigned int size; // used for mantaining a stack and queue }; typedef EntityArr EntityArrayList; struct EntityArr entity_arr_init(struct Arena *arena, unsigned int size); // -- basic insert remove operations -- void entity_arr_insert(struct EntityArr *arr, struct Entity to_insert, unsigned int index); struct Entity entity_arr_remove(struct EntityArr *arr, struct Entity to_remove, unsigned int index); void entity_arr_push_head(struct EntityArr *arr, struct Entity value); void entity_arr_push_tail(struct EntityArr *arr, struct Entity value); struct Entity entity_arr_pop_head(struct EntityArr *arr); struct Entity entity_arr_pop_tail(struct EntityArr *arr); typedef EntityArr EntityQueue; void entity_qpush(EntityQueue *queue, struct Entity value); struct Entity entity_qpop(EntityQueue *queue); typedef EntityArr EntityStack; void entity_spush(EntityStack *stack, struct Entity value); struct Entity entity_spop(EntityStack *stack, struct Entity value); // -- operations on values -- int entity_arr_find(struct EntityArr *arr, struct Entity value);