initial commit

This commit is contained in:
2025-02-25 12:07:16 +01:00
commit 0657bc9b25
34 changed files with 3069 additions and 0 deletions

28
src/Pieces/Rotation.h Normal file
View File

@@ -0,0 +1,28 @@
#pragma once
/**
* Every type of rotation that can be applied to an object in a 2D grid
*/
enum Rotation {
NONE,
CLOCKWISE,
DOUBLE,
COUNTERCLOCKWISE
};
/**
* Addition operator, returns a rotation corresponding to doing both rotations
*/
Rotation operator+(const Rotation& left, const Rotation& right) {
return Rotation((left + right) % 4);
}
/**
* Additive assignation operator, rotate the left rotation by the right rotation
*/
Rotation& operator+=(Rotation& left, const Rotation& right) {
left = left + right;
return left;
}