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