From: Erik V. <ev...@us...> - 2009-11-27 20:51:38
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9149/rails/game Modified Files: StartRound_1830.java StartRound_1835.java GameManagerI.java Round.java StockRound.java OperatingRound.java StartRound.java GameManager.java Log Message: Beautified report window contents & log Index: StartRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** StartRound.java 17 Nov 2009 22:38:29 -0000 1.30 --- StartRound.java 27 Nov 2009 20:35:18 -0000 1.31 *************** *** 21,24 **** --- 21,25 ---- protected String variant; protected Player currentPlayer; + protected Player startPlayer; /** *************** *** 77,82 **** setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); currentPlayer = getCurrentPlayer(); - ReportBuffer.add(""); ReportBuffer.add(LocalText.getText("StartOfInitialRound")); ReportBuffer.add(LocalText.getText("HasPriority", --- 78,83 ---- setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); currentPlayer = getCurrentPlayer(); + startPlayer = currentPlayer; ReportBuffer.add(LocalText.getText("StartOfInitialRound")); ReportBuffer.add(LocalText.getText("HasPriority", *************** *** 136,142 **** */ possibleActions.clear(); - //gameManager.nextRound(this); finishRound(); ! } else if (!setPossibleActions()) { /* * If nobody can do anything, keep executing Operating and Start --- 137,142 ---- */ possibleActions.clear(); finishRound(); ! // } else if (!setPossibleActions()) { /* * If nobody can do anything, keep executing Operating and Start *************** *** 145,149 **** * ultimately be possible. */ ! finishRound(); } --- 145,149 ---- * ultimately be possible. */ ! // finishRound(); } *************** *** 151,154 **** --- 151,156 ---- } + + /*----- Processing player actions -----*/ Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** GameManager.java 25 Nov 2009 18:48:19 -0000 1.70 --- GameManager.java 27 Nov 2009 20:35:18 -0000 1.71 *************** *** 72,75 **** --- 72,76 ---- protected int currentNumberOfOperatingRounds = 1; protected boolean skipFirstStockRound = false; + protected boolean showCompositeORNumber = true; protected boolean gameEndsWithBankruptcy = false; *************** *** 408,411 **** --- 409,414 ---- priorityPlayer.setState(players.get(0)); setPlayerCertificateLimit (playerManager.getInitialPlayerCertificateLimit()); + + showCompositeORNumber = !"simple".equalsIgnoreCase(Config.get("or.number_format")); } *************** *** 587,590 **** --- 590,601 ---- } + public String getORId () { + if (showCompositeORNumber) { + return getCompositeORNumber(); + } else { + return String.valueOf(absoluteORNumber.intValue()); + } + } + /* (non-Javadoc) * @see rails.game.GameManagerI#getCompositeORNumber() *************** *** 594,597 **** --- 605,612 ---- } + public int getRelativeORNumber() { + return relativeORNumber.intValue(); + } + public String getNumOfORs () { return new Integer(numOfORs).toString(); Index: Round.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Round.java 25 Nov 2009 18:44:45 -0000 1.29 --- Round.java 27 Nov 2009 20:35:18 -0000 1.30 *************** *** 184,187 **** --- 184,189 ---- PublicCompanyI comp = action.getCompany(); + ReportBuffer.add(""); + for (ExchangeableToken token : tokens) { cityName = token.getCityName(); Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** OperatingRound.java 26 Nov 2009 20:14:30 -0000 1.80 --- OperatingRound.java 27 Nov 2009 20:35:18 -0000 1.81 *************** *** 124,129 **** super (gameManager); - thisOrNumber = gameManager.getCompositeORNumber(); - if (players == null) { players = gameManager.getPlayers(); --- 124,127 ---- *************** *** 136,139 **** --- 134,142 ---- public void start(boolean operate) { + thisOrNumber = gameManager.getORId(); + + ReportBuffer.add(LocalText.getText("START_OR", thisOrNumber)); + + int count = 0; for (PrivateCompanyI priv : companyManager.getAllPrivateCompanies()) { if (!priv.isClosed()) { *************** *** 141,144 **** --- 144,148 ---- CashHolder recipient = ((Portfolio)priv.getHolder()).getOwner(); int revenue = priv.getRevenue(); + if (count++ == 0) ReportBuffer.add(""); ReportBuffer.add(LocalText.getText("ReceivesFor", recipient.getName(), *************** *** 151,156 **** } - ReportBuffer.add(LocalText.getText("START_OR", thisOrNumber)); - if (operate) { --- 155,158 ---- *************** *** 1009,1012 **** --- 1011,1017 ---- protected void initTurn() { log.debug("Starting turn of "+operatingCompany.getName()); + ReportBuffer.add(LocalText.getText("CompanyOperates", + operatingCompany.getName(), + operatingCompany.getPresident().getName())); setCurrentPlayer(operatingCompany.getPresident()); operatingCompany.initTurn(); Index: StartRound_1830.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** StartRound_1830.java 23 Nov 2009 18:32:45 -0000 1.25 --- StartRound_1830.java 27 Nov 2009 20:35:18 -0000 1.26 *************** *** 40,43 **** --- 40,44 ---- if (startPacket.areAllSold()) return false; + if (currentPlayer == startPlayer) ReportBuffer.add(""); while (possibleActions.isEmpty()) { Index: StartRound_1835.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1835.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** StartRound_1835.java 7 Oct 2009 19:00:38 -0000 1.21 --- StartRound_1835.java 27 Nov 2009 20:35:18 -0000 1.22 *************** *** 111,114 **** --- 111,116 ---- Player currentPlayer = getCurrentPlayer(); + if (currentPlayer == startPlayer) ReportBuffer.add(""); + int cashToSpend = currentPlayer.getCash(); Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** StockRound.java 25 Nov 2009 18:44:45 -0000 1.51 --- StockRound.java 27 Nov 2009 20:35:18 -0000 1.52 *************** *** 21,24 **** --- 21,25 ---- protected int numberOfPlayers; protected Player currentPlayer; + protected Player startingPlayer; protected State companyBoughtThisTurnWrapper = *************** *** 74,85 **** public void start() { ! ReportBuffer.add("\n" + LocalText.getText("StartStockRound", ! + getStockRoundNumber())); setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); initPlayer(); ! ReportBuffer.add(LocalText.getText("HasPriority", ! currentPlayer.getName() )); } --- 75,88 ---- public void start() { ! ReportBuffer.add(LocalText.getText("StartStockRound", ! getStockRoundNumber())); setCurrentPlayerIndex(gameManager.getPriorityPlayer().getIndex()); + startingPlayer = getCurrentPlayer(); // For the Report + ReportBuffer.add(LocalText.getText("HasPriority", + startingPlayer.getName() )); initPlayer(); ! } *************** *** 1188,1191 **** --- 1191,1195 ---- hasSoldThisTurnBeforeBuying.set(false); hasActed.set(false); + if (currentPlayer == startingPlayer) ReportBuffer.add(""); } Index: GameManagerI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManagerI.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** GameManagerI.java 25 Nov 2009 18:48:19 -0000 1.22 --- GameManagerI.java 27 Nov 2009 20:35:18 -0000 1.23 *************** *** 31,35 **** --- 31,37 ---- public abstract void nextRound(RoundI round); + public String getORId (); public abstract String getCompositeORNumber(); + public int getRelativeORNumber(); public abstract int getSRNumber(); |