pokemon_app.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 "pokemon_data.h"
  12. #define TAG "Pokemon"
  13. struct pokemon_data_table {
  14. const char* name;
  15. const Icon* icon;
  16. const uint8_t species;
  17. };
  18. typedef struct pokemon_data_table PokemonTable;
  19. typedef enum {
  20. GAMEBOY_INITIAL,
  21. GAMEBOY_READY,
  22. GAMEBOY_WAITING,
  23. GAMEBOY_TRADE_READY,
  24. GAMEBOY_SEND,
  25. GAMEBOY_PENDING,
  26. GAMEBOY_TRADING
  27. } render_gameboy_state_t;
  28. struct pokemon_fap {
  29. ViewDispatcher* view_dispatcher;
  30. /* View ports for each of the application's steps */
  31. View* select_view;
  32. View* trade_view;
  33. /* Table of pokemon data for Gen I */
  34. const PokemonTable* pokemon_table;
  35. /* Struct for holding trade data */
  36. /* NOTE: There may be some runtime memory savings by adding more intelligence
  37. * to views/trade and slimming down this struct to only contain the single
  38. * pokemon data rather than the full 6 member party data.
  39. */
  40. TradeBlock* trade_party;
  41. /* The currently selected pokemon */
  42. int curr_pokemon;
  43. /* Some state tracking */
  44. /* This, combined with some globals in trade.cpp, can probably be better
  45. * consolidated at some point.
  46. */
  47. bool trading;
  48. bool connected;
  49. render_gameboy_state_t gameboy_status;
  50. /* TODO: Other variables will end up here, like selected level, EV/IV,
  51. * moveset, etc. Likely will want to be another sub struct similar to
  52. * the actual pokemon data structure.
  53. */
  54. };
  55. typedef struct pokemon_fap PokemonFap;
  56. typedef enum {
  57. AppViewSelectPokemon,
  58. AppViewTrade,
  59. AppViewExitConfirm,
  60. } AppView;
  61. #endif /* POKEMON_APP_H */