Modified the ObjectStore and the Hashmap and added the ObjectStore to
the GameManager
This commit is contained in:
1 parent
a0e76bc1fc
commit
79f28100bd
8 files changed
+181
-73
No files matched your search
@@ -1,11 +1,15 @@
|
||||
#ifndef GAME_H
|
||||
#define GAME_H
|
||||
|
||||
#include "ObjectStore.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
bool init_game(const char *game_name, int window_width, int window_height,
|
||||
bool full_screen);
|
||||
bool game_running();
|
||||
void add_object(void *object, const char *object_tag, EventHandlerPtr eh,
|
||||
UpdateFuncPtr uf, RenderFuncPtr rf);
|
||||
void remove_object(const char *object_tag);
|
||||
void handle_events();
|
||||
void update();
|
||||
void render();
|
||||
+9
-7
@@ -9,15 +9,17 @@
|
||||
#include <stdio.h>
|
||||
#endif /* DEBUG_ENGINE */
|
||||
|
||||
void init_hashmap();
|
||||
int32_t add_object_to_map(const char *key);
|
||||
int32_t get_object_index(const char *key);
|
||||
int32_t delete_object_from_map(const char *key);
|
||||
void destroy_hashmap();
|
||||
typedef struct hashmap Hashmap;
|
||||
|
||||
Hashmap *create_hashmap();
|
||||
int32_t add_object_to_map(Hashmap *map, const char *key);
|
||||
int32_t get_object_index(Hashmap *map, const char *key);
|
||||
int32_t delete_object_from_map(Hashmap *map, const char *key);
|
||||
void destroy_hashmap(Hashmap *map);
|
||||
|
||||
#ifdef DEBUG_ENGINE
|
||||
void print_hashmap();
|
||||
void print_non_empty();
|
||||
void print_hashmap(Hashmap *map);
|
||||
void print_non_empty(Hashmap *map);
|
||||
#endif // DEBUG_ENGINE
|
||||
|
||||
#endif // !HASHMAP_H
|
||||
@@ -22,7 +22,7 @@ void render_all_objects(ObjectStore *os, Renderer *renderer);
|
||||
void destroy_object_store(ObjectStore *os);
|
||||
|
||||
#ifdef DEBUG_ENGINE
|
||||
void print_objects();
|
||||
void print_objects(ObjectStore *os);
|
||||
#endif /* DEBUG_ENGINE */
|
||||
|
||||
#endif // !OBJECT_STORE_H
|
||||
Reference in new issue
Block a user