#pragma once #include #include #include namespace sunrise::state::account::inventory { /** The profile and character writebacks carry 704 and 352 new-item bits. */ using ProfileNewItems = std::array; using CharacterNewItems = std::array; /** A delivered acquisition can temporarily place an item outside its usual row. */ struct PresentedItemRow { std::uint64_t instanceSoid{}; std::uint16_t inventoryRow{}; }; [[nodiscard]] bool record_profile_seen(const ProfileNewItems& newItems) noexcept; [[nodiscard]] bool record_character_seen(const CharacterNewItems& newItems, std::span presentation = {}) noexcept; /** A clear bit means the item at that published row has been seen. */ template [[nodiscard]] bool seen_at(const std::array& bits, std::size_t row) noexcept { constexpr std::size_t kWordBits = 32; return row < N * kWordBits && (bits[row / kWordBits] & (1U << (row % kWordBits))) == 0; } } // namespace sunrise::state::account::inventory