1 |
|
|
#include "PlayState.hpp" |
2 |
|
|
|
3 |
|
|
namespace blink1_lib { |
4 |
|
10 |
PlayState::PlayState(const bool _playing, const std::uint8_t _playStart, const std::uint8_t _playEnd, const std::uint8_t _playCount, const std::uint8_t _playPos) noexcept |
5 |
|
10 |
: playing(_playing), playStart(_playStart), playEnd(_playEnd), playCount(_playCount), playPos(_playPos) |
6 |
|
10 |
{} |
7 |
|
|
|
8 |
|
6 |
bool PlayState::operator==(const PlayState& other) const noexcept { |
9 |
|
6 |
return playing == other.playing |
10 |
✓✓ |
5 |
&& playStart == other.playStart |
11 |
✓✓ |
4 |
&& playEnd == other.playEnd |
12 |
✓✓ |
3 |
&& playCount == other.playCount |
13 |
✓✓✓✓
|
11 |
&& playPos == other.playPos; |
14 |
|
|
} |
15 |
|
|
|
16 |
|
5 |
bool PlayState::operator!=(const PlayState& other) const noexcept { |
17 |
|
5 |
return !(*this == other); |
18 |
|
|
} |
19 |
|
|
|
20 |
|
2 |
std::ostream& operator<<(std::ostream& os, const PlayState& playState) { |
21 |
|
|
os << "PlayState{" |
22 |
|
2 |
<< "playing=" << (playState.playing ? "true" : "false") |
23 |
✓✓ |
2 |
<< ", playStart=" << static_cast<unsigned>(playState.playStart) |
24 |
|
2 |
<< ", playEnd=" << static_cast<unsigned>(playState.playEnd) |
25 |
|
2 |
<< ", playCount=" << static_cast<unsigned>(playState.playCount) |
26 |
|
2 |
<< ", playPos=" << static_cast<unsigned>(playState.playPos) |
27 |
|
2 |
<< "}"; |
28 |
|
2 |
return os; |
29 |
|
|
} |
30 |
|
|
} |