tmp
This commit is contained in:
@@ -55,8 +55,8 @@ public class MainFXMLController {
|
||||
private HBox popupCards;
|
||||
|
||||
private ClientController controller;
|
||||
private CurrentState old_state;
|
||||
private CurrentState new_state;
|
||||
private GameStages old_state_stage;
|
||||
private String old_state_username;
|
||||
|
||||
|
||||
public void setController(ClientController controller) {
|
||||
@@ -68,8 +68,9 @@ public class MainFXMLController {
|
||||
|
||||
@FXML
|
||||
public void initialize() {
|
||||
old_state=null;
|
||||
new_state=null;
|
||||
old_state_stage=null;
|
||||
old_state_username="";
|
||||
|
||||
|
||||
// Import font and apply CSS
|
||||
Font.loadFont(getClass().getResourceAsStream("/Fonts/InknutAntiqua-Regular.ttf"), 14);
|
||||
@@ -86,32 +87,38 @@ public class MainFXMLController {
|
||||
|
||||
|
||||
public void render() {
|
||||
new_state=controller.miniModel.currentState;
|
||||
|
||||
System.out.println("OLD: "+old_state+", NEW: "+new_state);
|
||||
if (old_state==null) {
|
||||
if (old_state_stage==null) {
|
||||
renderBackground();
|
||||
renderUpper();
|
||||
renderBoard();
|
||||
renderLower();
|
||||
renderMyHand();
|
||||
renderSidePanel();
|
||||
} else if (old_state.getGameStage()==SLOT_CHOICE) {
|
||||
} else if (old_state_stage==SLOT_CHOICE) {
|
||||
System.out.println("OLD: "+old_state_stage+", NEW: "+controller.miniModel.currentState.getGameStage());
|
||||
System.out.println("RIDISEGNO BOARD\n");
|
||||
renderBoard();
|
||||
} else if (old_state.getGameStage()==RES_ACTIONS) {
|
||||
System.out.println("RIDISEGNO TUTTO");
|
||||
} else if (old_state_stage==RES_ACTIONS) {
|
||||
System.out.println("OLD: "+old_state_stage+", NEW: "+controller.miniModel.currentState.getGameStage());
|
||||
System.out.println("RIDISEGNO TUTTO. USERNAME: "+old_state_username);
|
||||
renderUpper();
|
||||
renderBoard();
|
||||
renderLower();
|
||||
renderSidePanel();
|
||||
renderMyHand();
|
||||
//renderMyHand();
|
||||
|
||||
if (old_state_username==controller.myUsername) {
|
||||
renderMyHand();
|
||||
}
|
||||
|
||||
// TODO: se sono io a pescare renderizzo myHand, altrimenti no (non è scontato)
|
||||
} else {
|
||||
System.out.println("NON GESTITO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
}
|
||||
|
||||
old_state=new_state;
|
||||
old_state_stage=controller.miniModel.currentState.getGameStage();
|
||||
old_state_username=controller.miniModel.currentState.getCurrentPlayer().getUserName();
|
||||
// TODO: le info in sidepanel non vengono aggiornate sempre aggiornate, bisogna prima capire dove metterle
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user