2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-09 23:19:17 +00:00
|
|
|
|
2022-02-19 13:04:45 +00:00
|
|
|
#include "Runtime/Streams/IOStreams.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2018-12-08 05:30:43 +00:00
|
|
|
|
|
|
|
class CSegId {
|
2019-10-27 01:53:11 +00:00
|
|
|
u8 x0_segId = 0xFF;
|
2016-04-09 23:19:17 +00:00
|
|
|
|
|
|
|
public:
|
2019-10-27 01:33:39 +00:00
|
|
|
constexpr CSegId() noexcept = default;
|
|
|
|
constexpr CSegId(u8 id) noexcept : x0_segId(id) {}
|
2022-02-21 00:02:40 +00:00
|
|
|
explicit CSegId(CInputStream& in) : x0_segId(in.ReadLong()) {}
|
2019-10-27 01:33:39 +00:00
|
|
|
constexpr CSegId& operator++() noexcept {
|
2018-12-08 05:30:43 +00:00
|
|
|
++x0_segId;
|
|
|
|
return *this;
|
|
|
|
}
|
2019-10-27 01:33:39 +00:00
|
|
|
constexpr CSegId& operator--() noexcept {
|
2018-12-08 05:30:43 +00:00
|
|
|
--x0_segId;
|
|
|
|
return *this;
|
|
|
|
}
|
2019-10-27 01:33:39 +00:00
|
|
|
constexpr operator u8() const noexcept { return x0_segId; }
|
2019-10-27 01:53:11 +00:00
|
|
|
|
|
|
|
constexpr bool IsValid() const noexcept { return !IsInvalid(); }
|
|
|
|
constexpr bool IsInvalid() const noexcept { return x0_segId == 0xFF; }
|
2016-04-09 23:19:17 +00:00
|
|
|
};
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|