dolphin.h 905 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "furi/pubsub.h"
  3. #include "gui/view.h"
  4. #include "helpers/dolphin_deed.h"
  5. #include <stdbool.h>
  6. typedef struct Dolphin Dolphin;
  7. typedef struct {
  8. uint32_t icounter;
  9. uint32_t butthurt;
  10. uint64_t timestamp;
  11. uint8_t level;
  12. bool level_up_is_pending;
  13. } DolphinStats;
  14. typedef enum {
  15. DolphinPubsubEventUpdate,
  16. } DolphinPubsubEvent;
  17. /** Deed complete notification. Call it on deed completion.
  18. * See dolphin_deed.h for available deeds. In futures it will become part of assets.
  19. * Thread safe, async
  20. */
  21. void dolphin_deed(Dolphin* dolphin, DolphinDeed deed);
  22. /** Retrieve dolphin stats
  23. * Thread safe, blocking
  24. */
  25. DolphinStats dolphin_stats(Dolphin* dolphin);
  26. /** Flush dolphin queue and save state
  27. * Thread safe, blocking
  28. */
  29. void dolphin_flush(Dolphin* dolphin);
  30. void dolphin_upgrade_level(Dolphin* dolphin);
  31. FuriPubSub* dolphin_get_pubsub(Dolphin* dolphin);