From: Erik V. <ev...@us...> - 2010-05-15 16:36:20
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv5643/rails/ui/swing Modified Files: ORUIManager.java ORPanel.java Log Message: Rewritten code to assign next operating company to avoid the OperatingCompanyIndex state object. This was continually causing problems. Also partial implementation of 18EU bankruptcy; game currently hangs if this occurs. Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** ORUIManager.java 14 May 2010 15:19:57 -0000 1.73 --- ORUIManager.java 15 May 2010 16:36:09 -0000 1.74 *************** *** 112,116 **** public void initOR(OperatingRound or) { oRound = or; ! companies = (oRound).getOperatingCompanies(); map.updateOffBoardToolTips(); orWindow.activate(oRound); --- 112,116 ---- public void initOR(OperatingRound or) { oRound = or; ! companies = (oRound).getOperatingCompanies().toArray(new PublicCompanyI[0]); map.updateOffBoardToolTips(); orWindow.activate(oRound); *************** *** 1103,1109 **** JOptionPane.QUESTION_MESSAGE, null, options, options[0]); ! int index = oldTrainOptions.indexOf(exchangedTrainName); ! if (index >= 0) { ! exchangedTrain = oldTrains.get(index); } } --- 1103,1115 ---- JOptionPane.QUESTION_MESSAGE, null, options, options[0]); ! if (exchangedTrainName != null) { ! int index = oldTrainOptions.indexOf(exchangedTrainName); ! if (index >= 0) { ! exchangedTrain = oldTrains.get(index); ! } ! } ! if (exchangedTrain == null) { ! // No valid train selected - cancel the buy action ! train = null; } } Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** ORPanel.java 14 May 2010 15:19:58 -0000 1.63 --- ORPanel.java 15 May 2010 16:36:09 -0000 1.64 *************** *** 145,149 **** if (round instanceof OperatingRound) { ! companies = ((OperatingRound) round).getOperatingCompanies(); nc = companies.length; } --- 145,149 ---- if (round instanceof OperatingRound) { ! companies = ((OperatingRound) round).getOperatingCompanies().toArray(new PublicCompanyI[0]); nc = companies.length; } *************** *** 218,222 **** log.debug("ORPanel.recreate() called"); ! companies = or.getOperatingCompanies(); nc = companies.length; --- 218,222 ---- log.debug("ORPanel.recreate() called"); ! companies = or.getOperatingCompanies().toArray(new PublicCompanyI[0]); nc = companies.length; *************** *** 603,607 **** RevenueAdapter ra = new RevenueAdapter(gm, nwGraph, company, gm.getCurrentPhase()); ra.populateFromRails(); ! boolean anotherTrain = true; while (anotherTrain) { --- 603,607 ---- RevenueAdapter ra = new RevenueAdapter(gm, nwGraph, company, gm.getCurrentPhase()); ra.populateFromRails(); ! boolean anotherTrain = true; while (anotherTrain) { |