You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
918 B
44 lines
918 B
#ifndef ENTITY_H_
|
|
#define ENTITY_H_
|
|
#include "../Sprite/sprite.h"
|
|
#include "../game.h"
|
|
#include "task.h"
|
|
#include "../Textures/animationHandler.h"
|
|
|
|
typedef struct Entity Entity;
|
|
|
|
typedef struct Entity{
|
|
Sprite *sprite;
|
|
AnimationHandler *animationHandler;
|
|
|
|
float angle;
|
|
float destX;
|
|
float destY;
|
|
int hasDestination;
|
|
int selected;
|
|
int profession;
|
|
|
|
Task *task;
|
|
void (*act)(Game *, Entity *);
|
|
|
|
Entity *next;
|
|
Entity *prev;
|
|
} Entity;
|
|
|
|
typedef struct EntityList{
|
|
Entity *head;
|
|
Entity *tail;
|
|
} EntityList;
|
|
|
|
Entity * EntityInit(Game *game, int profession, int x, int y);
|
|
EntityList * EntityListInit();
|
|
|
|
void EntityMoveToDestination(Entity *entity);
|
|
|
|
void EntityListPrintForward(EntityList *entities);
|
|
void EntityListInsert(EntityList *entities, Entity *data);
|
|
void EntityListRemove(EntityList *entities, Entity *remove);
|
|
void EntityListActAllEntities(Game *game);
|
|
|
|
#endif
|