diff options
Diffstat (limited to 'src/piece.cpp')
-rw-r--r-- | src/piece.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/piece.cpp b/src/piece.cpp index d686a32..05dab12 100644 --- a/src/piece.cpp +++ b/src/piece.cpp @@ -1,4 +1,12 @@ #include "piece.h" +#include<cstdlib> + +Piece::Piece(int xpos){ + + int divisor = static_cast<int>(Piece::PieceType::L); + auto type = static_cast<Piece::PieceType>(rand() % divisor); + restartTo(type, xpos); +} Piece::Piece(Piece::PieceType type, int xpos){ restartTo(type, xpos); |