pokemon_app.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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/select_level.hpp"
  13. #include "views/select_move1.hpp"
  14. #include "views/select_move2.hpp"
  15. #include "views/select_move3.hpp"
  16. #include "views/select_move4.hpp"
  17. #include "views/trade.hpp"
  18. #define TAG "Pokemon"
  19. struct pokemon_lut {
  20. const char* name;
  21. const Icon* icon;
  22. const uint8_t hex;
  23. const uint8_t type1;
  24. const uint8_t type2;
  25. const int xp_group;
  26. const int base_hp;
  27. const int base_atk;
  28. const int base_def;
  29. const int base_spd;
  30. const int base_special;
  31. };
  32. struct pokemon_mv {
  33. const char* name;
  34. const uint8_t hex;
  35. };
  36. typedef struct App App;
  37. typedef enum {
  38. GAMEBOY_INITIAL,
  39. GAMEBOY_READY,
  40. GAMEBOY_WAITING,
  41. GAMEBOY_TRADE_READY,
  42. GAMEBOY_SEND,
  43. GAMEBOY_PENDING,
  44. GAMEBOY_TRADING
  45. } render_gameboy_state_t;
  46. struct App {
  47. Gui* gui;
  48. ViewDispatcher* view_dispatcher;
  49. SelectPokemon* select_pokemon;
  50. SelectLevel* select_level;
  51. SelectMove1* select_move1;
  52. SelectMove2* select_move2;
  53. SelectMove3* select_move3;
  54. SelectMove4* select_move4;
  55. Trade* trade;
  56. uint32_t view_id;
  57. int current_pokemon = 0;
  58. int current_level = 3;
  59. int current_move = 0;
  60. char pokemon_hex_code = ' ';
  61. char move1_hex_code = ' ';
  62. char move2_hex_code = ' ';
  63. char move3_hex_code = ' ';
  64. char move4_hex_code = ' ';
  65. };
  66. typedef enum {
  67. AppViewSelectPokemon,
  68. AppViewSelectLevel,
  69. AppViewSelectMove1,
  70. AppViewSelectMove2,
  71. AppViewSelectMove3,
  72. AppViewSelectMove4,
  73. AppViewTrade,
  74. AppViewExitConfirm,
  75. } AppView;
  76. typedef void (*SelectPokemonCallback)(void* context, uint32_t index);
  77. typedef struct SelectPokemonModel {
  78. int current_pokemon = 0;
  79. int current_level = 3;
  80. int current_move = 0;
  81. char pokemon_hex_code = ' ';
  82. char move1_hex_code = ' ';
  83. char move2_hex_code = ' ';
  84. char move3_hex_code = ' ';
  85. char move4_hex_code = ' ';
  86. bool trading = false;
  87. bool connected = false;
  88. render_gameboy_state_t gameboy_status = GAMEBOY_INITIAL;
  89. SelectPokemonCallback callback;
  90. void* callback_context;
  91. } SelectPokemonModel;
  92. extern struct pokemon_lut pokemon_table[];
  93. extern struct pokemon_mv move_table[];
  94. #endif /* POKEMON_APP_H */