inline les fonctions opérateurs hors classes
This commit is contained in:
@@ -38,7 +38,8 @@ bool PiecesFiles::savePieces(int order) const {
|
||||
std::sort(nMinos.begin(), nMinos.end());
|
||||
|
||||
// write pieces
|
||||
Color pieceColor = Color(FIRST_PIECE_COLOR + (order % (LAST_PIECE_COLOR - FIRST_PIECE_COLOR + 1)));
|
||||
Color pieceColor = firstPieceColor();
|
||||
for (int i = 0; i < order; i++) nextPieceColor(pieceColor);
|
||||
for (const Polyomino& nMino : nMinos) {
|
||||
// write polyomino length
|
||||
char lengthByte = nMino.getLength();
|
||||
@@ -46,7 +47,7 @@ bool PiecesFiles::savePieces(int order) const {
|
||||
|
||||
// write the type and color of the piece
|
||||
char infoByte = (nMino.isConvex() << 7) + (nMino.hasHole() << 6) + pieceColor;
|
||||
pieceColor = (pieceColor == LAST_PIECE_COLOR) ? FIRST_PIECE_COLOR : Color(pieceColor + 1);
|
||||
nextPieceColor(pieceColor);
|
||||
piecesFile.write(&infoByte, 1);
|
||||
|
||||
// write the cells of the piece
|
||||
|
||||
Reference in New Issue
Block a user