current_activity.h 1.0 KB

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <cstdint>
  3. namespace sunrise::state::activity {
  4. /**
  5. * The activity the account is currently in.
  6. *
  7. * A collectible pickup arrives as an incident, and which book it should fill depends on where the
  8. * player is. The incident does carry the bubble, but only in a position that differs per incident
  9. * type, and there are several: a vase reports type 2 and a dead ghost type 10, each with its own
  10. * schema. The selection that put the player there already names the bubble once, so keeping it is
  11. * cheaper than decoding every type's payload and works for types not yet seen.
  12. */
  13. /** No activity has been selected yet. */
  14. inline constexpr std::uint32_t kNoBubble = 0;
  15. /**
  16. * Records the arrival bubble of the activity just selected.
  17. * @param bubble Arrival bubble hash, or kNoBubble when the selection carried none.
  18. */
  19. void set_current_bubble(std::uint32_t bubble) noexcept;
  20. /** @return The arrival bubble of the current activity, or kNoBubble. */
  21. [[nodiscard]] std::uint32_t current_bubble() noexcept;
  22. } // namespace sunrise::state::activity