activity_sdk_dialogue_group_index.h 909 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <cstddef>
  3. #include <cstdint>
  4. #include <span>
  5. #include <vector>
  6. namespace sunrise::client::content::activity::sdk_generation::dialogue_group_index {
  7. /** One content range keyed by its authored dialogue definition hash. */
  8. struct Span final {
  9. std::uint32_t definitionHash{};
  10. std::size_t begin{};
  11. std::size_t end{};
  12. };
  13. /** Builds a hash-sorted index from the native 16-byte dialogue group rows. */
  14. [[nodiscard]] bool build(std::span<const std::byte> bytes,
  15. std::size_t groupRows,
  16. std::size_t groupCount,
  17. std::vector<Span>& output) noexcept;
  18. /** Finds the content range for one cue definition hash. */
  19. [[nodiscard]] bool
  20. find(std::span<const Span> groups, std::uint32_t definitionHash, Span& output) noexcept;
  21. } // namespace sunrise::client::content::activity::sdk_generation::dialogue_group_index