|
@ -145,6 +145,8 @@ private: |
|
|
// ------------------------------------------------------------------------------------- //
|
|
|
// ------------------------------------------------------------------------------------- //
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// TODO: add debug output
|
|
|
|
|
|
|
|
|
class Group { |
|
|
class Group { |
|
|
public: |
|
|
public: |
|
|
Group() = delete; |
|
|
Group() = delete; |
|
@ -152,25 +154,25 @@ public: |
|
|
// ------------------------------------------------------------------------------------- //
|
|
|
// ------------------------------------------------------------------------------------- //
|
|
|
|
|
|
|
|
|
/// Get the original type id.
|
|
|
/// Get the original type id.
|
|
|
[[nodiscard]] uint32_t type_id() const; |
|
|
[[nodiscard]] constexpr uint32_t type_id() const; |
|
|
|
|
|
|
|
|
/// Get the original group id.
|
|
|
/// Get the original group id.
|
|
|
[[nodiscard]] uint32_t group_id() const; |
|
|
[[nodiscard]] constexpr uint32_t group_id() const; |
|
|
|
|
|
|
|
|
/// Create Group without any check.
|
|
|
/// Create Group without any check.
|
|
|
static Group unsafe_create(uint32_t type_id, uint32_t group_id); |
|
|
static constexpr Group unsafe_create(uint32_t type_id, uint32_t group_id); |
|
|
|
|
|
|
|
|
/// Create Group with validity check.
|
|
|
/// Create Group with validity check.
|
|
|
static std::optional<Group> create(uint32_t type_id, uint32_t group_id); |
|
|
static constexpr std::optional<Group> create(uint32_t type_id, uint32_t group_id); |
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------- //
|
|
|
// ------------------------------------------------------------------------------------- //
|
|
|
|
|
|
|
|
|
/// Get the number of cases contained.
|
|
|
/// Get all cases under current group.
|
|
|
[[nodiscard]] uint32_t size() const; |
|
|
|
|
|
|
|
|
|
|
|
/// Get all cases under the current group.
|
|
|
|
|
|
[[nodiscard]] RangesUnion cases() const; |
|
|
[[nodiscard]] RangesUnion cases() const; |
|
|
|
|
|
|
|
|
|
|
|
/// Get the number of klotski cases contained.
|
|
|
|
|
|
[[nodiscard]] constexpr uint32_t size() const; |
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------- //
|
|
|
// ------------------------------------------------------------------------------------- //
|
|
|
|
|
|
|
|
|
/// Create Group from RawCode.
|
|
|
/// Create Group from RawCode.
|
|
@ -188,7 +190,8 @@ private: |
|
|
uint32_t type_id_; |
|
|
uint32_t type_id_; |
|
|
uint32_t group_id_; |
|
|
uint32_t group_id_; |
|
|
|
|
|
|
|
|
[[nodiscard]] uint32_t flat_id() const; |
|
|
/// Tiled merge of type_id and group_id.
|
|
|
|
|
|
[[nodiscard]] constexpr uint32_t flat_id() const; |
|
|
|
|
|
|
|
|
public: |
|
|
public: |
|
|
/// Spawn all the unsorted codes of the current group.
|
|
|
/// Spawn all the unsorted codes of the current group.
|
|
|