item.h 798 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. item.h
  3. */
  4. #ifndef _ITEM_H
  5. #define _ITEM_H
  6. #include <stdint.h>
  7. struct _pos_struct
  8. {
  9. uint8_t x;
  10. uint8_t y;
  11. };
  12. typedef struct _pos_struct pos_t;
  13. struct _item_struct
  14. {
  15. pos_t pos;
  16. uint8_t dir; /* movement has two parts: 1. dir is set, then 2. dir is executed */
  17. uint8_t tile; /* current foreground tile, defaults to the value from the template list */
  18. uint8_t template_index; /* index into item_template_list[] */
  19. };
  20. typedef struct _item_struct item_t;
  21. item_t *pool_GetItem(uint8_t idx);
  22. void posStep(pos_t *pos, uint8_t dir);
  23. void moveAllItems(void);
  24. void callStepAllItems(void);
  25. uint8_t getMapTileByPos(pos_t *pos);
  26. void setupLevel(uint8_t level);
  27. uint8_t getMapTile(uint8_t x, uint8_t y);
  28. uint8_t moveItem(uint8_t item_index, uint8_t dir);
  29. #endif /* _ITEM_H */