TileRotate: added operator +=

Dieser Commit ist enthalten in:
Reinder Feenstra 2020-12-21 23:09:52 +01:00
Ursprung 1cd6d802c6
Commit 3bf8a3c59e

Datei anzeigen

@ -43,6 +43,12 @@ constexpr TileRotate operator +(TileRotate lhs, TileRotate rhs)
return static_cast<TileRotate>((static_cast<std::underlying_type_t<TileRotate>>(lhs) + static_cast<std::underlying_type_t<TileRotate>>(rhs)) % 8);
}
constexpr TileRotate& operator +=(TileRotate& lhs, TileRotate rhs)
{
lhs = lhs + rhs;
return lhs;
}
constexpr TileRotate operator -(TileRotate lhs, TileRotate rhs)
{
return static_cast<TileRotate>((static_cast<std::underlying_type_t<TileRotate>>(lhs) + 8 - static_cast<std::underlying_type_t<TileRotate>>(rhs)) % 8);