// animate.h - headers for a small integer energy system #include #include #include #include struct ani; struct anivec; typedef int (*ani_update)(struct ani *ent, size_t turn); typedef struct { int xx; int yy; } coord; struct ani { int alive; int newbie; int disp; int energy; coord pos; ani_update update; }; struct anivec { size_t count; struct ani *entry; }; struct anivec *ani_init(size_t count); void anivec_update(struct anivec *av, size_t turn); struct ani *ani_create(struct anivec *av, int disp, int energy, ani_update fn); void ani_murder(struct ani *ep);