Merge pull request #3 from rubenpirreram/currentstateB
Fix: CurrentState Now Correctly Handles 'null' Slot Input
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user