diff options
Diffstat (limited to 'src/entity.h')
| -rw-r--r-- | src/entity.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/entity.h b/src/entity.h index 9c842d3..72fadb4 100644 --- a/src/entity.h +++ b/src/entity.h @@ -40,7 +40,12 @@ #define SHOPKEEPER_HEIGHT (2.59521 / 2.0) #define SHOPKEEPER_THICKNESS (0.493349 / 2.0) +#define INTERACTION_MENU_MAX 9 +#define INTERACTION_LABEL_MAX 64 +#define ENTITY_DEFAULT_STATE -1 + typedef int8_t EntityId; +typedef int8_t EntityState; enum { ENTITY_NONE = -1, @@ -60,15 +65,39 @@ enum { RON }; +typedef enum { + INTERACTION_TALK, + INTERACTION_SHOW_MENU, + INTERACTION_END +} InteractionCommand; + +typedef enum { + SELECTION_INTERACT, + SELECTION_NEXT_MESSAGE, + SELECTION_MENU_ITEM, // +x to select any given menu entry + SELECTION_LEAVE +} Selection; + typedef struct { EntityId id; Vector3 position; // Shouldnt be changed directly. BoundingBox box; + EntityState state; } Entity; +typedef void (*InteractionCallback)(Entity* entity, Game* game); + +typedef struct { + char label[INTERACTION_LABEL_MAX]; + InteractionCallback callback; +} InteractionMenuEntry; + Entity createEntity(EntityId id, Vector3 position); void updateEntity(Entity* entity, Game* game); void setEntityPosition(Entity* entity, Vector3 position); void placeEntityOnGround(Entity* entity, const World* world); +InteractionCommand interactWithEntity(Entity* entity, Game* game, + Selection selection); + #endif |
