level.h 539 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include <stddef.h>
  3. #include "entity.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct {
  8. void (*alloc)(Level* level, void* context);
  9. void (*free)(Level* level, void* context);
  10. void (*start)(Level* level, void* context);
  11. void (*stop)(Level* level, void* context);
  12. size_t context_size;
  13. } LevelBehaviour;
  14. void level_clear(Level* level);
  15. Entity* level_add_entity(Level* level, const EntityDescription* behaviour);
  16. void level_remove_entity(Level* level, Entity* entity);
  17. #ifdef __cplusplus
  18. }
  19. #endif