app_gameplay.h 1.2 KB

1234567891011121314151617181920212223242526272829
  1. #include <stdbool.h>
  2. typedef enum PlayerType { PlayerType_Human, PlayerType_AiRandom, PlayerType_COUNT } PlayerType;
  3. typedef struct AppGameplayState AppGameplayState;
  4. typedef struct GameState GameState;
  5. typedef enum PlayerTurn PlayerTurn;
  6. AppGameplayState* gameplay_alloc();
  7. void gameplay_free(AppGameplayState* gameplay);
  8. void gameplay_reset(AppGameplayState* gameplay);
  9. GameState* gameplay_get_game(AppGameplayState* gameplay);
  10. int gameplay_selection_get_hand_index(AppGameplayState* gameplay);
  11. int gameplay_get_selected_card(AppGameplayState* gameplay);
  12. void gameplay_selection_delta(AppGameplayState* gameplay, int delta);
  13. void gameplay_selection_handle_delta(AppGameplayState* gameplay, int dx, int dy);
  14. bool gameplay_selection_perform_current(AppGameplayState* gameplay);
  15. PlayerType gameplay_get_player_type(AppGameplayState* gameplay, PlayerTurn playerIndex);
  16. PlayerType gameplay_get_next_player_type(AppGameplayState* gameplay);
  17. void gameplay_set_player_type(
  18. AppGameplayState* gameplay,
  19. PlayerTurn playerIndex,
  20. PlayerType playerType);
  21. int gameplay_get_last_action_at(AppGameplayState* gameplay);
  22. void gameplay_set_last_action_at(AppGameplayState* gameplay, int lastActionAt);