pokemon_app.h 2.5 KB

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