pokemon_app.h 1.7 KB

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