scriptable_override_route.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include <cstdint>
  3. #include "../../state/build_data/scriptables/definition.h"
  4. #include "host_runtime.h"
  5. namespace sunrise::server::activity::scriptable_override {
  6. /** Why one package row can or cannot use the existing msg-5 roster path. */
  7. enum class Eligibility : std::uint8_t {
  8. eligible,
  9. staleBinding,
  10. wrongScenario,
  11. incomplete,
  12. unstable,
  13. unsupportedSchema,
  14. noEffectiveRegion,
  15. noRosterGroup,
  16. inactiveBubble,
  17. ambiguousRosterGroup,
  18. };
  19. /** Exact canonical target and the result of resolving it. */
  20. struct Resolution final {
  21. host::ScriptableTarget target{};
  22. Eligibility eligibility{Eligibility::noRosterGroup};
  23. };
  24. /**
  25. * Joins one package-derived slot to an existing canonical roster row.
  26. * It never creates a group and accepts bubble-local rows only while their bubble is reported.
  27. * @param binding Exact Activity Host generation selected in the panel.
  28. * @param snapshot Immutable dynamic package catalog for that destination.
  29. * @param objectRow Selected object row.
  30. * @param slotRow Selected slot row owned by the object.
  31. * @param effectiveRegion Exact region selected from the unique BAP ActivityClient.
  32. * @param output Cleared, then receives the canonical roster indices and status.
  33. * @return True only when the current destination already registers this exact full layout.
  34. */
  35. [[nodiscard]] bool resolve(const state::activity::SessionBinding& binding,
  36. const state::build_data::scriptables::Snapshot& snapshot,
  37. std::uint32_t objectRow,
  38. std::uint32_t slotRow,
  39. std::int32_t effectiveRegion,
  40. Resolution& output) noexcept;
  41. /** @return Stable UI explanation for one eligibility result. */
  42. [[nodiscard]] const char* eligibility_name(Eligibility value) noexcept;
  43. } // namespace sunrise::server::activity::scriptable_override