From: Erik V. <ev...@us...> - 2009-05-04 20:29:26
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29969/rails/ui/swing/gamespecific/_1856 Modified Files: StatusWindow_1856.java Log Message: 1856 CGR formation round Index: StatusWindow_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StatusWindow_1856.java 4 Feb 2009 20:36:40 -0000 1.1 --- StatusWindow_1856.java 4 May 2009 20:29:15 -0000 1.2 *************** *** 7,10 **** --- 7,12 ---- import rails.game.*; + import rails.game.action.DiscardTrain; + import rails.game.action.ExchangeTokens; import rails.game.action.RepayLoans; import rails.game.specific._1856.CGRFormationRound; *************** *** 21,35 **** public void updateStatus() { RoundI currentRound = gameUIManager.getCurrentRound(); ! if (!(currentRound instanceof OperatingRound)) { ! return; ! } else if (!(currentRound instanceof CGRFormationRound)) { super.updateStatus(); } else if (possibleActions.contains(RepayLoans.class)) { ! RepayLoans action = possibleActions.getType(RepayLoans.class).get(0); ! repayLoans (action); } } ! // Code copied from ORUIManager protected void repayLoans (RepayLoans action) { --- 23,72 ---- public void updateStatus() { RoundI currentRound = gameUIManager.getCurrentRound(); ! //if (!(currentRound instanceof OperatingRound)) { ! if (!(currentRound instanceof CGRFormationRound)) { super.updateStatus(); } else if (possibleActions.contains(RepayLoans.class)) { ! //RepayLoans action = possibleActions.getType(RepayLoans.class).get(0); ! //repayLoans (action); ! immediateAction = possibleActions.getType(RepayLoans.class).get(0); ! } else if (possibleActions.contains(DiscardTrain.class)) { ! immediateAction = possibleActions.getType(DiscardTrain.class).get(0); ! } else if (possibleActions.contains(ExchangeTokens.class)) { ! immediateAction = possibleActions.getType(ExchangeTokens.class).get(0); } } ! @Override ! public boolean processImmediateAction() { ! ! if (immediateAction == null) { ! return false; ! } else if (immediateAction instanceof RepayLoans) { ! // Make a local copy and discard the original, ! // so that it's not going to loop. ! RepayLoans nextAction = (RepayLoans) immediateAction; ! immediateAction = null; ! repayLoans (nextAction); ! return true; ! } else if (immediateAction instanceof DiscardTrain) { ! // Make a local copy and discard the original, ! // so that it's not going to loop. ! DiscardTrain nextAction = (DiscardTrain) immediateAction; ! immediateAction = null; ! gameUIManager.discardTrains (nextAction); ! return true; ! } else if (immediateAction instanceof ExchangeTokens) { ! // Make a local copy and discard the original, ! // so that it's not going to loop. ! ExchangeTokens nextAction = (ExchangeTokens) immediateAction; ! immediateAction = null; ! gameUIManager.exchangeTokens (nextAction); ! return true; ! } else { ! return super.processImmediateAction(); ! } ! } ! ! // Code partly copied from ORUIManager protected void repayLoans (RepayLoans action) { *************** *** 55,59 **** message[displayBufSize] = LocalText.getText("SelectLoansToRepay", action.getCompanyName()); ! Object choice = JOptionPane.showInputDialog(this, message, --- 92,96 ---- message[displayBufSize] = LocalText.getText("SelectLoansToRepay", action.getCompanyName()); ! Object choice = JOptionPane.showInputDialog(this, message, |