#ifndef PRES_STATE_MACHINE_H
#define PRES_STATE_MACHINE_H

#include <stdbool.h>

typedef struct Presentation_State Presentation_State;

typedef void (*Presentation_State_Enter_Callback)(Presentation_State *state);
typedef void (*Presentation_State_Tick_Callback)(Presentation_State *state);
typedef void (*Presentation_State_Render_Callback)(Presentation_State *state);
typedef void (*Presentation_State_Exit_Callback)(Presentation_State *state);

struct Presentation_State {
    const char *name;
    void *context;

    Presentation_State_Enter_Callback enter;
    Presentation_State_Tick_Callback tick;
    Presentation_State_Render_Callback render;
    Presentation_State_Exit_Callback exit;
};

Presentation_State presentation_state_create(
    const char *name,
    void *context,
    Presentation_State_Enter_Callback enter,
    Presentation_State_Tick_Callback tick,
    Presentation_State_Render_Callback render,
    Presentation_State_Exit_Callback exit
);

typedef struct {
    Presentation_State *current;
} Presentation_State_Machine;

extern Presentation_State_Machine presentation_state_machine;

bool presentation_state_machine_go_to(Presentation_State *target);

#endif