Solve the position problem
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr 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
parent fed275ba09
commit 158bb00283
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

View File

@ -114,7 +114,8 @@ public class BinaryParser implements FileParser {
ret[piece_index] = new Piece(_piece_matrix); ret[piece_index] = new Piece(_piece_matrix);
if(saved_data){ 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); ret[piece_index].setPosition(_piece_pos);
} }