暂无描述

game_engine.h 3.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /****************************************************************************
  2. * Copyright (C) 2015-2016 by the SotS Team *
  3. * *
  4. * This file is part of Sovereign of the Skies. *
  5. * *
  6. * Sovereign of the Skies is free software: you can redistribute it *
  7. * and/or modify it *
  8. * under the terms of the GNU Lesser General Public License as published *
  9. * by the Free Software Foundation, either version 3 of the License, or *
  10. * (at your option) any later version provided you include a copy of the *
  11. * licence and this header. *
  12. * *
  13. * Sovereign of the Skies is distributed in the hope that it will be *
  14. * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  16. * GNU Lesser General Public License for more details. *
  17. * *
  18. * You should have received a copy of the GNU Lesser General Public *
  19. * License along with Sovereign of the Skies. *
  20. * If not, see <http://www.gnu.org/licenses/>. *
  21. ****************************************************************************/
  22. /**
  23. * @file game_engine.h
  24. * @author Sturmvogel
  25. * @date 15 dec 2016
  26. * @brief Game Environment
  27. *
  28. * This header file contains methods to interact with the game environment,
  29. * misc. functions i.e. access to flags / variables and (encrypted) pokémon
  30. * data.
  31. */
  32. #ifndef GAME_ENGINE_H
  33. #define GAME_ENGINE_H
  34. /* === INCLUDE === */
  35. #include <types.h>
  36. /* === EXTERN METHODS === */
  37. /**
  38. * @brief get pointer of var
  39. * @param index variable to access
  40. * @return pointer to given variable storage
  41. */
  42. extern u16 *var_access(u32 index);
  43. /**
  44. * @brief checks if flag is set
  45. * @param flag index of flag to check
  46. * @return flag status (bool)
  47. */
  48. extern u8 flag_check(u32 flag);
  49. /**
  50. * @brief clears a flag
  51. * @param flag flag index to clear
  52. */
  53. extern void flag_clear(u16 flag);
  54. /**
  55. * @brief gets attribute of pokémon
  56. * @param poke_address address to pokémon structure
  57. * @param request request from the attribute request table
  58. * @param destination destination to write to (if not returned directly)
  59. * @return requested value (if not too big)
  60. */
  61. extern u32 pokemon_get_attribute(struct pokemon* poke_address, u8 request, void* destination);
  62. /**
  63. * @brief sets attribute of pokémon
  64. * @param poke_address address to pokémon structure
  65. * @param request request from the attribute request table
  66. * @param new_value pointer to new value
  67. */
  68. void pokemon_set_attribute(struct pokemon* poke_address, u8 request, void* new_value);
  69. #endif /* GAME_ENGINE_H */