eco2d/code/apps/client/source/entity_view.c

28 lines
774 B
C
Raw Normal View History

2021-05-05 09:25:05 +00:00
#include "entity_view.h"
ZPL_TABLE_DEFINE(entity_view_tbl, entity_view_tbl_, entity_view);
2021-05-06 15:30:38 +00:00
void entity_view_init(entity_view_tbl *map) {
entity_view_tbl_init(map, zpl_heap());
2021-05-05 09:25:05 +00:00
}
2021-05-06 15:30:38 +00:00
void entity_view_free(entity_view_tbl *map) {
entity_view_tbl_destroy(map);
2021-05-05 09:25:05 +00:00
}
2021-05-06 15:30:38 +00:00
void entity_view_update_or_create(entity_view_tbl *map, uint64_t ent_id, entity_view data) {
entity_view_tbl_set(map, ent_id, data);
2021-05-05 09:25:05 +00:00
}
2021-05-06 15:30:38 +00:00
void entity_view_destroy(entity_view_tbl *map, uint64_t ent_id) {
entity_view_tbl_remove(map, ent_id);
2021-05-05 09:25:05 +00:00
}
2021-05-06 15:30:38 +00:00
entity_view *entity_view_get(entity_view_tbl *map, uint64_t ent_id) {
return entity_view_tbl_get(map, ent_id);
2021-05-05 09:25:05 +00:00
}
2021-05-06 15:30:38 +00:00
void entity_view_map(entity_view_tbl *map, void (*map_proc)(uint64_t key, entity_view value)) {
entity_view_tbl_map(map, map_proc);
2021-05-05 09:25:05 +00:00
}