#pragma once #include "player.h" #include "exit.h" #include "deathpart.h" #include struct Game; enum { ET_NONE = 0 }; typedef struct Entity Entity; struct Entity { unsigned long uuid; Entity *(*update)(Entity *this, struct Game *g); Entity *(*draw)(Entity *this, struct Game *g); unsigned int type; int id; int pos[2]; double vel[2]; double rem[2]; int width; int height; bool ignore_solids; bool bonk_ceiling; union { Player player; Exit exit; DeathPart deathpart; }; }; unsigned int entity_type(const char *type); bool entity_collide(Entity *this, struct Game *g, int ox, int oy); bool entity_meet(Entity *this, Entity *other); Entity *entity_place_meeting(Entity *this, struct Game *g, unsigned int type); void entity_move(Entity *this, struct Game *g);