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