mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 06:27:43 +00:00
CSegId: Add member functions for querying validity
Allows querying validity of segment IDs without hardcoding the magic value that signifies an invalid ID.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
namespace urde {
|
||||
|
||||
class CSegId {
|
||||
u8 x0_segId = 0xff;
|
||||
u8 x0_segId = 0xFF;
|
||||
|
||||
public:
|
||||
constexpr CSegId() noexcept = default;
|
||||
@@ -21,6 +21,9 @@ public:
|
||||
return *this;
|
||||
}
|
||||
constexpr operator u8() const noexcept { return x0_segId; }
|
||||
|
||||
constexpr bool IsValid() const noexcept { return !IsInvalid(); }
|
||||
constexpr bool IsInvalid() const noexcept { return x0_segId == 0xFF; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user