Solve the position problem
All checks were successful
continuous-integration/drone/push Build is passing

The position was set to (70,76) for all floating pieces because it was
the value received.
nowk, if thes values are given (for the characters F & L as specified in
the specification in the rapport), the piece is set in a floating state
(position = null)
This commit is contained in:
Debucquoy Anthony 2023-05-18 20:19:40 +02:00 committed by Gitea
parent 41be423f94
commit 9bc66ad6b1

View File

@ -114,7 +114,8 @@ public class BinaryParser implements FileParser {
ret[piece_index] = new Piece(_piece_matrix);
if(saved_data){
Vec2 _piece_pos = new Vec2(pieces_positions[piece_index*2], pieces_positions[piece_index*2 + 1]);
Vec2 _piece_pos = (pieces_positions[piece_index*2] == 70 && pieces_positions[piece_index*2+1] == 76) ?
null : new Vec2(pieces_positions[piece_index*2], pieces_positions[piece_index*2 + 1]);
ret[piece_index].setPosition(_piece_pos);
}