common/uuid: Add validity checking functions to interface
Given we have a function to invalidate, we should also have ones to query the validity. Also makes the code more straightforward to read.
This commit is contained in:
parent
7b22d61fb1
commit
40314cc586
4 changed files with 14 additions and 7 deletions
|
@ -58,6 +58,13 @@ struct UUID {
|
|||
uuid = INVALID_UUID;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr bool IsInvalid() const {
|
||||
return uuid == INVALID_UUID;
|
||||
}
|
||||
[[nodiscard]] constexpr bool IsValid() const {
|
||||
return !IsInvalid();
|
||||
}
|
||||
|
||||
// TODO(ogniK): Properly generate a Nintendo ID
|
||||
[[nodiscard]] constexpr u64 GetNintendoID() const {
|
||||
return uuid[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue