pokemon_app.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef POKEMON_APP_H
  2. #define POKEMON_APP_H
  3. #pragma once
  4. #include <furi.h>
  5. #include <furi_hal_light.h>
  6. #include <gui/gui.h>
  7. #include <gui/view.h>
  8. #include <gui/view_dispatcher.h>
  9. #include <gui/icon.h>
  10. #include <pokemon_icons.h>
  11. #include "views/select_pokemon.hpp"
  12. #include "views/trade.hpp"
  13. #define TAG "Pokemon"
  14. typedef struct App App;
  15. typedef enum {
  16. GAMEBOY_INITIAL,
  17. GAMEBOY_READY,
  18. GAMEBOY_WAITING,
  19. GAMEBOY_TRADE_READY,
  20. GAMEBOY_SEND,
  21. GAMEBOY_PENDING,
  22. GAMEBOY_TRADING
  23. } render_gameboy_state_t;
  24. struct App {
  25. Gui* gui;
  26. ViewDispatcher* view_dispatcher;
  27. SelectPokemon* select_pokemon;
  28. Trade* trade;
  29. uint32_t view_id;
  30. int current_pokemon = 0;
  31. char pokemon_hex_code = ' ';
  32. };
  33. typedef enum {
  34. AppViewSelectPokemon,
  35. AppViewTrade,
  36. AppViewExitConfirm,
  37. } AppView;
  38. typedef void (*SelectPokemonCallback)(void* context, uint32_t index);
  39. typedef struct SelectPokemonModel {
  40. int current_pokemon = 0;
  41. char pokemon_hex_code = ' ';
  42. bool trading = false;
  43. bool connected = false;
  44. render_gameboy_state_t gameboy_status = GAMEBOY_INITIAL;
  45. SelectPokemonCallback callback;
  46. void* callback_context;
  47. } SelectPokemonModel;
  48. extern const char* pokemon_names[];
  49. extern const Icon* pokemon_icons[];
  50. extern const unsigned char pokemon_hex_codes[];
  51. #endif /* POKEMON_APP_H */