Merge pull request #3 from rubenpirreram/currentstateB

Fix: CurrentState Now Correctly Handles 'null' Slot Input
This commit is contained in:
GabrieleRadice
2026-03-28 19:31:46 +01:00
committed by GitHub
@@ -66,7 +66,6 @@ public class CurrentState {
// endregion setters // endregion setters
// region Constructors // region Constructors
// TODO controllare valori di NUpper, NLower, Round
public CurrentState(){ public CurrentState(){
this.player = null; this.player = null;
this.slot = null; this.slot = null;
@@ -82,8 +81,15 @@ public class CurrentState {
public void PlayerUpdate(Player player, Slot slot){ public void PlayerUpdate(Player player, Slot slot){
this.player = player; this.player = player;
this.slot = slot; this.slot = slot;
this.NUpper = slot.getNUpper(); if(slot == null){
this.NLower = slot.getNLower(); this.NUpper = 0;
this.NLower = 0;
}
else{
this.NUpper = slot.getNUpper();
this.NLower = slot.getNLower();
}
} }
// endregion functions // endregion functions
} }