Fix: CurrentState Now Correctly Handles 'null' Slot Input

This commit is contained in:
GabrieleRadice
2026-03-28 19:30:42 +01:00
parent d0c8108fbc
commit c9ed1ac7e5
@@ -66,7 +66,6 @@ public class CurrentState {
// endregion setters
// region Constructors
// TODO controllare valori di NUpper, NLower, Round
public CurrentState(){
this.player = null;
this.slot = null;
@@ -82,8 +81,15 @@ public class CurrentState {
public void PlayerUpdate(Player player, Slot slot){
this.player = player;
this.slot = slot;
this.NUpper = slot.getNUpper();
this.NLower = slot.getNLower();
if(slot == null){
this.NUpper = 0;
this.NLower = 0;
}
else{
this.NUpper = slot.getNUpper();
this.NLower = slot.getNLower();
}
}
// endregion functions
}