43 lines
771 B
C
43 lines
771 B
C
#ifndef ENTITY_H
|
|
#define ENTITY_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef uint16_t Entity_ID;
|
|
|
|
#define INVALID_ENTITY_ID (Entity_ID)65535
|
|
|
|
typedef enum {
|
|
Entity_Movement_Direction_None,
|
|
Entity_Movement_Direction_Up,
|
|
Entity_Movement_Direction_Down,
|
|
Entity_Movement_Direction_Right,
|
|
Entity_Movement_Direction_Left,
|
|
} Entity_Movement_Direction;
|
|
|
|
typedef enum {
|
|
Entity_Type_Snake_Head,
|
|
Entity_Type_Snake_Body,
|
|
Entity_Type_Food,
|
|
} Entity_Type;
|
|
|
|
typedef struct {
|
|
bool active;
|
|
|
|
Entity_ID id;
|
|
|
|
Entity_Type type;
|
|
|
|
uint16_t x;
|
|
uint16_t y;
|
|
|
|
uint16_t prev_x;
|
|
uint16_t prev_y;
|
|
|
|
Entity_Movement_Direction move_direction;
|
|
|
|
Entity_ID child;
|
|
} Entity;
|
|
|
|
#endif |