You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(46) |
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(51) |
Feb
(10) |
Mar
|
Apr
|
May
(14) |
Jun
|
Jul
(13) |
Aug
(30) |
Sep
(83) |
Oct
(56) |
Nov
(148) |
Dec
(107) |
2010 |
Jan
(260) |
Feb
(164) |
Mar
(183) |
Apr
(99) |
May
(160) |
Jun
(40) |
Jul
(33) |
Aug
(48) |
Sep
(22) |
Oct
(24) |
Nov
(1) |
Dec
(12) |
2011 |
Jan
(6) |
Feb
(15) |
Mar
(13) |
Apr
(37) |
May
(27) |
Jun
(29) |
Jul
(33) |
Aug
(20) |
Sep
(17) |
Oct
(20) |
Nov
(33) |
Dec
(17) |
2012 |
Jan
(39) |
Feb
(38) |
Mar
(20) |
Apr
(21) |
May
(17) |
Jun
(22) |
Jul
(16) |
Aug
(3) |
Sep
(9) |
Oct
(10) |
Nov
|
Dec
|
From: Erik V. <ev...@us...> - 2009-09-01 19:30:24
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27720/rails/ui/swing Modified Files: ORPanel.java Log Message: Fix loans display in OR panel Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ORPanel.java 28 Aug 2009 20:27:38 -0000 1.30 --- ORPanel.java 1 Sep 2009 19:30:15 -0000 1.31 *************** *** 118,122 **** private PublicCompanyI orComp = null; ! private List<JMenuItem> menuItemsToReset = new ArrayList<JMenuItem>(); --- 118,122 ---- private PublicCompanyI orComp = null; ! private List<JMenuItem> menuItemsToReset = new ArrayList<JMenuItem>(); *************** *** 418,422 **** if (hasCompanyLoans) { ! if (c.canLoan()) { f = compLoans[i] = new Field (c.getLoanValueModel()); } else { --- 418,423 ---- if (hasCompanyLoans) { ! //if (c.canLoan()) { ! if (c.getLoanValueModel() != null) { f = compLoans[i] = new Field (c.getLoanValueModel()); } else { *************** *** 558,562 **** president[i].setHighlight(false); } ! for (JMenuItem item : menuItemsToReset) { item.setEnabled(false); --- 559,563 ---- president[i].setHighlight(false); } ! for (JMenuItem item : menuItemsToReset) { item.setEnabled(false); *************** *** 723,737 **** if (action != null) redoButton.setPossibleAction(action); } ! public void enableLoanTaking (TakeLoans action) { if (action != null) takeLoans.addPossibleAction(action); takeLoans.setEnabled(action != null); } ! public void enableLoanRepayment (RepayLoans action) { ! repayLoans.setPossibleAction(action); repayLoans.setEnabled(true); ! loansCaption.setHighlight(true); --- 724,738 ---- if (action != null) redoButton.setPossibleAction(action); } ! public void enableLoanTaking (TakeLoans action) { if (action != null) takeLoans.addPossibleAction(action); takeLoans.setEnabled(action != null); } ! public void enableLoanRepayment (RepayLoans action) { ! repayLoans.setPossibleAction(action); repayLoans.setEnabled(true); ! loansCaption.setHighlight(true); |
From: Erik V. <ev...@us...> - 2009-09-01 19:29:56
|
Update of /cvsroot/rails/18xx/rails/game/model In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27496/rails/game/model Modified Files: CertCountModel.java Log Message: Fix cert count display Index: CertCountModel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/CertCountModel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CertCountModel.java 30 Aug 2009 20:50:29 -0000 1.7 --- CertCountModel.java 1 Sep 2009 19:29:46 -0000 1.8 *************** *** 13,17 **** public String getText() { ! return ("" + owner.getPortfolio().getCertificateCount()).replaceFirst(".0", "").replaceFirst(".5", "\u00bd"); } --- 13,17 ---- public String getText() { ! return ("" + owner.getPortfolio().getCertificateCount()).replaceFirst("\\.0", "").replaceFirst("\\.5", "\u00bd"); } |
From: Erik V. <ev...@us...> - 2009-08-31 22:36:00
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20663/rails/game/specific/_1856 Modified Files: PublicCompany_State.java Log Message: Special train buying rules for 1856 CGR Index: PublicCompany_State.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/PublicCompany_State.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PublicCompany_State.java 30 Aug 2009 18:15:18 -0000 1.2 --- PublicCompany_State.java 31 Aug 2009 22:35:51 -0000 1.3 *************** *** 13,16 **** --- 13,20 ---- private boolean hadPermanentTrain = false; + public PublicCompany_State() { + super(); + mustTradeTrainsAtFixedPrice = true; + } public boolean hadPermanentTrain() { return hadPermanentTrain; *************** *** 57,59 **** --- 61,73 ---- } + @Override + public boolean mustOwnATrain() { + if (!hadPermanentTrain) { + return false; + } else { + return super.mustOwnATrain(); + } + } + + } |
From: Erik V. <ev...@us...> - 2009-08-31 22:36:00
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20663/rails/game Modified Files: OperatingRound.java Log Message: Special train buying rules for 1856 CGR Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** OperatingRound.java 19 Jul 2009 19:24:21 -0000 1.61 --- OperatingRound.java 31 Aug 2009 22:35:51 -0000 1.62 *************** *** 243,249 **** result = repayLoans((RepayLoans) selectedAction); ! } else if (selectedAction instanceof ExchangeTokens) { ! result = exchangeTokens ((ExchangeTokens)selectedAction); --- 243,249 ---- result = repayLoans((RepayLoans) selectedAction); ! } else if (selectedAction instanceof ExchangeTokens) { ! result = exchangeTokens ((ExchangeTokens)selectedAction); *************** *** 1743,1747 **** if (repayment > 0) executeRepayLoans (action); ! doneAllowed = true; --- 1743,1747 ---- if (repayment > 0) executeRepayLoans (action); ! doneAllowed = true; *************** *** 1794,1798 **** return numberOfLoans * operatingCompany.getValuePerLoan(); } ! /*----- METHODS TO BE CALLED TO SET UP THE NEXT TURN -----*/ --- 1794,1798 ---- return numberOfLoans * operatingCompany.getValuePerLoan(); } ! /*----- METHODS TO BE CALLED TO SET UP THE NEXT TURN -----*/ *************** *** 1958,1963 **** * trains that the company has no money for. If there is no cash to buy any * train from the Bank, prepare for emergency train buying. - * - * @return List of all trains that could potentially be bought. */ public void setBuyableTrains() { --- 1958,1961 ---- *************** *** 1976,1980 **** operatingCompany.getNumberOfTrains() >= operatingCompany.getCurrentTrainLimit(); boolean canBuyTrainNow = canBuyTrain(); ! boolean presidentMayHelp = operatingCompany.mustOwnATrain(); TrainI cheapestTrain = null; int costOfCheapestTrain = 0; --- 1974,1978 ---- operatingCompany.getNumberOfTrains() >= operatingCompany.getCurrentTrainLimit(); boolean canBuyTrainNow = canBuyTrain(); ! boolean presidentMayHelp = !hasTrains && operatingCompany.mustOwnATrain(); TrainI cheapestTrain = null; int costOfCheapestTrain = 0; *************** *** 2054,2058 **** && cheapestTrain != null && presidentMayHelp) { possibleActions.add(new BuyTrain(cheapestTrain, ! cheapestTrain.getHolder(), costOfCheapestTrain).setPresidentMustAddCash(costOfCheapestTrain - cash)); } --- 2052,2057 ---- && cheapestTrain != null && presidentMayHelp) { possibleActions.add(new BuyTrain(cheapestTrain, ! cheapestTrain.getHolder(), costOfCheapestTrain) ! .setPresidentMustAddCash(costOfCheapestTrain - cash)); } *************** *** 2074,2078 **** companiesPerPlayer.add(new ArrayList<PublicCompanyI>(4)); List<PublicCompanyI> companies; ! // Sort out which players preside over wich companies. for (int j = 0; j < operatingCompanyArray.length; j++) { c = operatingCompanyArray[j]; --- 2073,2077 ---- companiesPerPlayer.add(new ArrayList<PublicCompanyI>(4)); List<PublicCompanyI> companies; ! // Sort out which players preside over which companies. for (int j = 0; j < operatingCompanyArray.length; j++) { c = operatingCompanyArray[j]; *************** *** 2095,2100 **** if (train.isObsolete()) continue; if (i != currentPlayerIndex ! && trainMgr.buyAtFaceValueBetweenDifferentPresidents()) { ! bt = new BuyTrain(train, pf, train.getCost()); } else { bt = new BuyTrain(train, pf, 0); --- 2094,2105 ---- if (train.isObsolete()) continue; if (i != currentPlayerIndex ! && trainMgr.buyAtFaceValueBetweenDifferentPresidents() ! || operatingCompany.mustTradeTrainsAtFixedPrice() ! || company.mustTradeTrainsAtFixedPrice()) { ! if (cash >= train.getCost()) { ! bt = new BuyTrain(train, pf, train.getCost()); ! } else { ! continue; ! } } else { bt = new BuyTrain(train, pf, 0); |
From: Erik V. <ev...@us...> - 2009-08-31 22:35:30
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20576/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Minor change in imports Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** OperatingRound_1856.java 28 Aug 2009 20:49:20 -0000 1.14 --- OperatingRound_1856.java 31 Aug 2009 22:35:21 -0000 1.15 *************** *** 1,8 **** package rails.game.specific._1856; ! import java.util.ArrayList; ! import java.util.Arrays; ! import java.util.Iterator; ! import java.util.List; import rails.game.*; --- 1,5 ---- package rails.game.specific._1856; ! import java.util.*; import rails.game.*; *************** *** 455,462 **** // Find the first company that has not yet operated // and is not closed. ! while (setNextOperatingCompany(false) && getOperatingCompany().isClosed()); ! ! List<PublicCompanyI> companies = new ArrayList<PublicCompanyI>(Arrays.asList(operatingCompanyArray)); PublicCompanyI company; --- 452,459 ---- // Find the first company that has not yet operated // and is not closed. ! while (setNextOperatingCompany(false) && getOperatingCompany().isClosed()); ! ! List<PublicCompanyI> companies = new ArrayList<PublicCompanyI>(Arrays.asList(operatingCompanyArray)); PublicCompanyI company; *************** *** 472,484 **** } } ! if (operatingCompany != null) { operatingCompanyIndex = companies.indexOf(operatingCompany); } ! for (PublicCompanyI c : companies) { log.debug("Now operating: "+c.getName()); } ! String message; if (cgr.hasStarted()) { --- 469,481 ---- } } ! if (operatingCompany != null) { operatingCompanyIndex = companies.indexOf(operatingCompany); } ! for (PublicCompanyI c : companies) { log.debug("Now operating: "+c.getName()); } ! String message; if (cgr.hasStarted()) { *************** *** 499,505 **** operatingCompanyArray = companies.toArray(new PublicCompanyI[0]); operatingCompanyIndexObject.set(operatingCompanyIndex); ! log.debug ("Next operating company: "+operatingCompany.getName()); ! } @Override --- 496,502 ---- operatingCompanyArray = companies.toArray(new PublicCompanyI[0]); operatingCompanyIndexObject.set(operatingCompanyIndex); ! log.debug ("Next operating company: "+operatingCompany.getName()); ! } @Override |
From: Erik V. <ev...@us...> - 2009-08-31 22:34:20
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20271/rails/game Modified Files: PublicCompanyI.java PublicCompany.java Log Message: Added boolean mustTradeTrainsAtFixedPrice (for 1856 CGR) Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** PublicCompany.java 30 Aug 2009 18:15:18 -0000 1.52 --- PublicCompany.java 31 Aug 2009 22:34:01 -0000 1.53 *************** *** 218,221 **** --- 218,223 ---- protected boolean mustOwnATrain = true; + protected boolean mustTradeTrainsAtFixedPrice = false; + /** Initial train at floating time */ protected String initialTrain = null; *************** *** 464,468 **** = certificateTag.getAttributeAsBoolean("available", certsAreInitiallyAvailable); ! float certificateCount = certificateTag.getAttributeAsFloat("certificateCount", 1.0f); --- 466,470 ---- = certificateTag.getAttributeAsBoolean("available", certsAreInitiallyAvailable); ! float certificateCount = certificateTag.getAttributeAsFloat("certificateCount", 1.0f); *************** *** 1638,1641 **** --- 1640,1647 ---- } + public boolean mustTradeTrainsAtFixedPrice() { + return mustTradeTrainsAtFixedPrice; + } + public int getCurrentNumberOfLoans() { return currentNumberOfLoans.intValue(); *************** *** 1658,1662 **** return maxNumberOfLoans; } ! public boolean canLoan() { return maxNumberOfLoans > 0; --- 1664,1668 ---- return maxNumberOfLoans; } ! public boolean canLoan() { return maxNumberOfLoans > 0; Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** PublicCompanyI.java 28 Aug 2009 20:27:38 -0000 1.29 --- PublicCompanyI.java 31 Aug 2009 22:34:01 -0000 1.30 *************** *** 326,329 **** --- 326,330 ---- public boolean mustOwnATrain(); + public boolean mustTradeTrainsAtFixedPrice(); public int getCurrentNumberOfLoans(); *************** *** 336,340 **** public int getValuePerLoan(); public MoneyModel getLoanValueModel (); ! public int sharesOwnedByPlayers(); } --- 337,341 ---- public int getValuePerLoan(); public MoneyModel getLoanValueModel (); ! public int sharesOwnedByPlayers(); } |
From: Erik V. <ev...@us...> - 2009-08-31 22:33:05
|
Update of /cvsroot/rails/18xx/data/1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20129/data/1856 Modified Files: CompanyManager.xml Log Message: Fix: CGR 10% Pres share counts as 1 certificate Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/CompanyManager.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** CompanyManager.xml 30 Aug 2009 18:15:19 -0000 1.27 --- CompanyManager.xml 31 Aug 2009 22:32:52 -0000 1.28 *************** *** 20,24 **** <PoolPaysOut/> <ShareUnit percentage="5"/> ! <Certificate type="President" shares="2" certificateCount="0.5"/> <Certificate shares="1" number="18" certificateCount="0.5"/> <BaseTokens> --- 20,24 ---- <PoolPaysOut/> <ShareUnit percentage="5"/> ! <Certificate type="President" shares="2" certificateCount="1"/> <Certificate shares="1" number="18" certificateCount="0.5"/> <BaseTokens> |
From: Erik V. <ev...@us...> - 2009-08-30 20:50:38
|
Update of /cvsroot/rails/18xx/rails/game/model In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23325/rails/game/model Modified Files: CertCountModel.java Log Message: Use Unicode \u00bd for ½ (0.5) Index: CertCountModel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/CertCountModel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CertCountModel.java 30 Aug 2009 19:28:34 -0000 1.6 --- CertCountModel.java 30 Aug 2009 20:50:29 -0000 1.7 *************** *** 13,17 **** public String getText() { ! return ("" + owner.getPortfolio().getCertificateCount()).replaceFirst(".0", "").replaceFirst(".5", "½"); } --- 13,17 ---- public String getText() { ! return ("" + owner.getPortfolio().getCertificateCount()).replaceFirst(".0", "").replaceFirst(".5", "\u00bd"); } |
From: Erik V. <ev...@us...> - 2009-08-30 19:44:55
|
Update of /cvsroot/rails/18xx/rails/game/model In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13182/rails/game/model Modified Files: CertCountModel.java Log Message: Added fractional certificate counts. 1856 CGR 5% shares now count as 0.5 certificate against limits Index: CertCountModel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/CertCountModel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CertCountModel.java 4 Jun 2008 19:00:37 -0000 1.4 --- CertCountModel.java 30 Aug 2009 18:15:18 -0000 1.5 *************** *** 13,17 **** public String getText() { ! return "" + owner.getPortfolio().getNumberOfCountedCertificates(); } --- 13,17 ---- public String getText() { ! return "" + owner.getPortfolio().getCertificateCount(); } |
From: Erik V. <ev...@us...> - 2009-08-30 19:44:43
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13182/rails/game/specific/_1856 Modified Files: PublicCompany_State.java Log Message: Added fractional certificate counts. 1856 CGR 5% shares now count as 0.5 certificate against limits Index: PublicCompany_State.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/PublicCompany_State.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PublicCompany_State.java 28 Aug 2009 20:27:38 -0000 1.1 --- PublicCompany_State.java 30 Aug 2009 18:15:18 -0000 1.2 *************** *** 37,40 **** --- 37,41 ---- new RemoveFromList<PublicCertificateI>(certificates, cert, "CGR_Certs"); } else { + cert.setCertificateCount(1.0f); share += cert.getShare(); } |
From: Erik V. <ev...@us...> - 2009-08-30 19:28:42
|
Update of /cvsroot/rails/18xx/rails/game/model In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17576/rails/game/model Modified Files: CertCountModel.java Log Message: Added fractional certificate counts. 1856 CGR 5% shares now count as 0.5 certificate against limits Index: CertCountModel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/model/CertCountModel.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CertCountModel.java 30 Aug 2009 18:15:18 -0000 1.5 --- CertCountModel.java 30 Aug 2009 19:28:34 -0000 1.6 *************** *** 13,17 **** public String getText() { ! return "" + owner.getPortfolio().getCertificateCount(); } --- 13,17 ---- public String getText() { ! return ("" + owner.getPortfolio().getCertificateCount()).replaceFirst(".0", "").replaceFirst(".5", "½"); } |
From: Erik V. <ev...@us...> - 2009-08-30 18:15:31
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13182/rails/game Modified Files: Portfolio.java PublicCompany.java PublicCertificate.java PublicCertificateI.java Player.java Log Message: Added fractional certificate counts. 1856 CGR 5% shares now count as 0.5 certificate against limits Index: Portfolio.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Portfolio.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Portfolio.java 4 May 2009 20:29:14 -0000 1.33 --- Portfolio.java 30 Aug 2009 18:15:18 -0000 1.34 *************** *** 236,242 **** /** Get the number of certificates that count against the certificate limit */ ! public int getNumberOfCountedCertificates() { ! int number = privateCompanies.size(); // May not hold for all games PublicCompanyI comp; --- 236,242 ---- /** Get the number of certificates that count against the certificate limit */ ! public float getCertificateCount() { ! float number = privateCompanies.size(); // May not hold for all games PublicCompanyI comp; *************** *** 245,249 **** if (!comp.hasFloated() || !comp.hasStockPrice() || !cert.getCompany().getCurrentSpace().isNoCertLimit()) ! number++; } return number; --- 245,249 ---- if (!comp.hasFloated() || !comp.hasStockPrice() || !cert.getCompany().getCurrentSpace().isNoCertLimit()) ! number += cert.getCertificateCount(); } return number; Index: PublicCertificate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCertificate.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PublicCertificate.java 28 Aug 2009 20:27:38 -0000 1.15 --- PublicCertificate.java 30 Aug 2009 18:15:18 -0000 1.16 *************** *** 21,24 **** --- 21,27 ---- /** President's certificate? */ protected boolean president; + /** Count against certificate limits */ + protected float certificateCount = 1.0f; + /** Availability at the start of the game */ protected boolean initiallyAvailable; *************** *** 39,54 **** Logger.getLogger(PublicCertificate.class.getPackage().getName()); ! public PublicCertificate(int shares) { ! this(shares, false, true); ! } ! ! public PublicCertificate(int shares, boolean president) { ! this(shares, president, true); ! } ! ! public PublicCertificate(int shares, boolean president, boolean available) { this.shares = shares; this.president = president; this.initiallyAvailable = available; } --- 42,51 ---- Logger.getLogger(PublicCertificate.class.getPackage().getName()); ! public PublicCertificate(int shares, boolean president, ! boolean available, float certificateCount) { this.shares = shares; this.president = president; this.initiallyAvailable = available; + this.certificateCount = certificateCount; } *************** *** 57,60 **** --- 54,58 ---- this.president = oldCert.isPresidentShare(); this.initiallyAvailable = oldCert.isInitiallyAvailable(); + this.certificateCount = oldCert.getCertificateCount(); } *************** *** 145,148 **** --- 143,154 ---- return initiallyAvailable; } + + public float getCertificateCount() { + return certificateCount; + } + + public void setCertificateCount(float certificateCount) { + this.certificateCount = certificateCount; + } /** Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** PublicCompany.java 28 Aug 2009 20:27:38 -0000 1.51 --- PublicCompany.java 30 Aug 2009 18:15:18 -0000 1.52 *************** *** 464,467 **** --- 464,469 ---- = certificateTag.getAttributeAsBoolean("available", certsAreInitiallyAvailable); + + float certificateCount = certificateTag.getAttributeAsFloat("certificateCount", 1.0f); if (president) { *************** *** 476,480 **** for (int k = 0; k < number; k++) { certificate = new PublicCertificate(shares, president, ! certIsInitiallyAvailable); addCertificate(certificate); shareTotal += shares * shareUnit.intValue(); --- 478,482 ---- for (int k = 0; k < number; k++) { certificate = new PublicCertificate(shares, president, ! certIsInitiallyAvailable, certificateCount); addCertificate(certificate); shareTotal += shares * shareUnit.intValue(); Index: Player.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Player.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Player.java 15 Jan 2009 20:53:28 -0000 1.16 --- Player.java 30 Aug 2009 18:15:18 -0000 1.17 *************** *** 107,111 **** // Over the total certificate hold Limit? ! if (portfolio.getNumberOfCountedCertificates() > playerCertificateLimit) return true; --- 107,111 ---- // Over the total certificate hold Limit? ! if (portfolio.getCertificateCount() > playerCertificateLimit) return true; *************** *** 129,133 **** if (comp.hasFloated() && comp.getCurrentSpace().isNoCertLimit()) return true; ! if (portfolio.getNumberOfCountedCertificates() + number > playerCertificateLimit) return false; return true; --- 129,133 ---- if (comp.hasFloated() && comp.getCurrentSpace().isNoCertLimit()) return true; ! if (portfolio.getCertificateCount() + number > playerCertificateLimit) return false; return true; Index: PublicCertificateI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCertificateI.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PublicCertificateI.java 28 Aug 2009 20:27:38 -0000 1.10 --- PublicCertificateI.java 30 Aug 2009 18:15:18 -0000 1.11 *************** *** 45,48 **** --- 45,52 ---- public boolean isInitiallyAvailable(); + public float getCertificateCount(); + + public void setCertificateCount(float certificateCount); + /** * @param portfolio |
From: Erik V. <ev...@us...> - 2009-08-30 18:15:28
|
Update of /cvsroot/rails/18xx/data/1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13182/data/1856 Modified Files: CompanyManager.xml Log Message: Added fractional certificate counts. 1856 CGR 5% shares now count as 0.5 certificate against limits Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/CompanyManager.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CompanyManager.xml 28 Aug 2009 20:27:38 -0000 1.26 --- CompanyManager.xml 30 Aug 2009 18:15:19 -0000 1.27 *************** *** 20,25 **** <PoolPaysOut/> <ShareUnit percentage="5"/> ! <Certificate type="President" shares="2"/> ! <Certificate shares="1" number="18"/> <BaseTokens> <LayCost method="sequence" cost="0,40,100"/> --- 20,25 ---- <PoolPaysOut/> <ShareUnit percentage="5"/> ! <Certificate type="President" shares="2" certificateCount="0.5"/> ! <Certificate shares="1" number="18" certificateCount="0.5"/> <BaseTokens> <LayCost method="sequence" cost="0,40,100"/> |
From: Erik V. <ev...@us...> - 2009-08-30 18:13:57
|
Update of /cvsroot/rails/18xx/rails/util In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13009/rails/util Modified Files: Tag.java Log Message: Add floating point parsing Index: Tag.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/Tag.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Tag.java 24 Dec 2008 14:51:39 -0000 1.9 --- Tag.java 30 Aug 2009 18:13:48 -0000 1.10 *************** *** 131,139 **** } ! public int getAttributeAsInteger(String name) throws ConfigurationException { ! return getAttributeAsInteger(name, 0); } public int[] getAttributeAsIntegerArray(String name, int[] defaultArray) throws ConfigurationException { --- 131,159 ---- } ! public float getAttributeAsFloat(String name) throws ConfigurationException { ! return getAttributeAsFloat(name, 0.0f); ! } ! ! public float getAttributeAsFloat(String name, float defaultValue) ! throws ConfigurationException { ! ! if (!parsed) parse(element); ! ! String value = attributes.get(name); ! if (value == null) return defaultValue; ! try { ! return Float.parseFloat(value); ! } catch (Exception e) { ! throw new ConfigurationException("Invalid floating point value: " + value, ! e); ! } } + public int getAttributeAsInteger(String name) throws ConfigurationException { + + return getAttributeAsInteger(name, 0); + } + public int[] getAttributeAsIntegerArray(String name, int[] defaultArray) throws ConfigurationException { |
From: Erik V. <ev...@us...> - 2009-08-30 18:13:40
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv12970/rails/ui/swing/hexmap Modified Files: GUITile.java Log Message: Minor change in logging Index: GUITile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUITile.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GUITile.java 30 Aug 2009 15:18:24 -0000 1.14 --- GUITile.java 30 Aug 2009 18:13:29 -0000 1.15 *************** *** 140,147 **** oldTrack.getEndPoint(prevTileSide)); } else { - log.debug ("downgrading..."); // Assume there are only two exits // (this is the only known case for downgrading: ! // #3->#7, #4->#9, #58->#8. // Find the other new exit int otherNewEndPoint = newTracks.get(0).getEndPoint(tempTileSide); --- 140,146 ---- oldTrack.getEndPoint(prevTileSide)); } else { // Assume there are only two exits // (this is the only known case for downgrading: ! // #3->#7, #4->#9, #58->#8). // Find the other new exit int otherNewEndPoint = newTracks.get(0).getEndPoint(tempTileSide); *************** *** 153,157 **** continue rot; } ! } } --- 152,156 ---- continue rot; } ! log.debug("[" + i + "," + j + "] Downgraded"); } } |
From: Erik V. <ev...@us...> - 2009-08-30 15:18:36
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv28055/rails/ui/swing/hexmap Modified Files: GUITile.java Log Message: Enabled village downgrading (as in 1856) Index: GUITile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUITile.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GUITile.java 30 Aug 2009 15:06:48 -0000 1.13 --- GUITile.java 30 Aug 2009 15:18:24 -0000 1.14 *************** *** 150,154 **** // That old tile side must have track too if (prevTile.getTracksPerSide(otherOldEndPoint) == null ! && prevTile.getTracksPerSide(otherOldEndPoint).isEmpty()) { continue rot; } --- 150,154 ---- // That old tile side must have track too if (prevTile.getTracksPerSide(otherOldEndPoint) == null ! || prevTile.getTracksPerSide(otherOldEndPoint).isEmpty()) { continue rot; } |
From: Erik V. <ev...@us...> - 2009-08-30 15:07:05
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26397/rails/ui/swing/hexmap Modified Files: GUITile.java Log Message: Enabled village downgrading (as in 1856) Index: GUITile.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUITile.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GUITile.java 26 Oct 2008 20:35:53 -0000 1.12 --- GUITile.java 30 Aug 2009 15:06:48 -0000 1.13 *************** *** 68,73 **** /** ! * Rotate right (clockwise) until a valid orientation is found. TODO: ! * Currently only impassable hex sides are taken into account. * * @param initial: First rotation to try. Should be 0 for the initial tile --- 68,72 ---- /** ! * Rotate right (clockwise) until a valid orientation is found. * * @param initial: First rotation to try. Should be 0 for the initial tile *************** *** 133,148 **** // Old track ending in a station // All old tracks ending the same/different ! // stations ! // must keep doing so. ! /* ! * for (Track newTrack : newTracks) { if ! * (newTrack.getEndPoint(tempTileSide) < 0 == ! * oldTrack.getEndPoint(prevTileSide) < 0) { // ! * OK, this old track is preserved continue old; } } ! */ ! log.debug("[" + i + "," + j + "] Found " + oldTrack.getEndPoint(prevTileSide)); ! oldCities.put(prevTileSide, oldTrack.getEndPoint(prevTileSide)); } } --- 132,158 ---- // Old track ending in a station // All old tracks ending the same/different ! // stations must keep doing so (except when ! // downgrading to plain track, as in 1856) ! if (tile.hasStations()) { ! log.debug("[" + i + "," + j + "] Found " + oldTrack.getEndPoint(prevTileSide)); ! oldCities.put(prevTileSide, oldTrack.getEndPoint(prevTileSide)); + } else { + log.debug ("downgrading..."); + // Assume there are only two exits + // (this is the only known case for downgrading: + // #3->#7, #4->#9, #58->#8. + // Find the other new exit + int otherNewEndPoint = newTracks.get(0).getEndPoint(tempTileSide); + // Calculate the corresponding old tile side number + int otherOldEndPoint = (otherNewEndPoint - tempRot + prevTileRotation +6 ) % 6; + // That old tile side must have track too + if (prevTile.getTracksPerSide(otherOldEndPoint) == null + && prevTile.getTracksPerSide(otherOldEndPoint).isEmpty()) { + continue rot; + } + + } } } |
From: Erik V. <ev...@us...> - 2009-08-28 20:49:35
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31079/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Added loadTakingAllowed as a Phase property Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** OperatingRound_1856.java 28 Aug 2009 20:27:38 -0000 1.13 --- OperatingRound_1856.java 28 Aug 2009 20:49:20 -0000 1.14 *************** *** 290,298 **** protected void setGameSpecificPossibleActions() { // Take a loan ! if ((loansThisRound == null || !loansThisRound.containsKey(operatingCompany) || loansThisRound.get(operatingCompany) == 0) - && gameManager.getCurrentPhase().getIndex() - <= gameManager.getPhaseManager().getPhaseByName("4").getIndex() && operatingCompany.getCurrentNumberOfLoans() < operatingCompany.sharesOwnedByPlayers()) { --- 290,298 ---- protected void setGameSpecificPossibleActions() { // Take a loan ! if (currentPhase.isLoanTakingAllowed() ! && operatingCompany.canLoan() ! && (loansThisRound == null || !loansThisRound.containsKey(operatingCompany) || loansThisRound.get(operatingCompany) == 0) && operatingCompany.getCurrentNumberOfLoans() < operatingCompany.sharesOwnedByPlayers()) { *************** *** 411,415 **** if (step == STEP_REPAY_LOANS) { - // Are we // Has company any outstanding loans to repay? if (operatingCompany.getMaxNumberOfLoans() == 0 --- 411,414 ---- |
From: Erik V. <ev...@us...> - 2009-08-28 20:49:29
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31079/rails/game Modified Files: Phase.java PhaseI.java Log Message: Added loadTakingAllowed as a Phase property Index: Phase.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Phase.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Phase.java 28 Aug 2009 20:27:38 -0000 1.11 --- Phase.java 28 Aug 2009 20:49:20 -0000 1.12 *************** *** 126,129 **** --- 126,135 ---- oneTrainPerTypePerTurn); } + + Tag loansTag = tag.getChild("Loans"); + if (loansTag != null) { + loanTakingAllowed = loansTag.getAttributeAsBoolean("allowed", + loanTakingAllowed); + } Tag parameterTag = tag.getChild("Parameters"); *************** *** 190,193 **** --- 196,203 ---- } + public boolean isLoanTakingAllowed() { + return loanTakingAllowed; + } + public int getNumberOfOperatingRounds() { return numberOfOperatingRounds; Index: PhaseI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PhaseI.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PhaseI.java 3 Nov 2008 15:55:00 -0000 1.6 --- PhaseI.java 28 Aug 2009 20:49:20 -0000 1.7 *************** *** 26,29 **** --- 26,31 ---- public boolean canBuyMoreTrainsPerTypePerTurn(); + public boolean isLoanTakingAllowed(); + public int getNumberOfOperatingRounds(); |
From: Erik V. <ev...@us...> - 2009-08-28 20:49:28
|
Update of /cvsroot/rails/18xx/data/1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31079/data/1856 Modified Files: Game.xml Log Message: Added loadTakingAllowed as a Phase property Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/Game.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Game.xml 4 May 2009 20:29:15 -0000 1.22 --- Game.xml 28 Aug 2009 20:49:20 -0000 1.23 *************** *** 52,55 **** --- 52,56 ---- <OperatingRounds number="1"/> <Trains tradingAllowed="yes"/> + <Loans allowed="yes"/> </Phase> <Phase name="2"> *************** *** 69,72 **** --- 70,74 ---- <Phase name="5"> <Tiles colour="yellow,green,brown,grey"/> + <Loans allowed="no"/> </Phase> <Phase name="6"> |
From: Erik V. <ev...@us...> - 2009-08-28 20:27:53
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29002/rails/ui/swing Modified Files: ORPanel.java GameStatus.java Log Message: Split off new class PublicCompany_State for 1856 CGR Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GameStatus.java 15 Jan 2009 20:53:28 -0000 1.23 --- GameStatus.java 28 Aug 2009 20:27:38 -0000 1.24 *************** *** 403,407 **** } if (hasCompanyLoans) { ! f = compLoans[i] = new Field (c.getLoanValueModel()); addField (f, compLoansXOffset, compLoansYOffset+i, 1, 1, 0); } --- 403,411 ---- } if (hasCompanyLoans) { ! if (c.getLoanValueModel() != null) { ! f = compLoans[i] = new Field (c.getLoanValueModel()); ! } else { ! f = compLoans[i] = new Field (""); ! } addField (f, compLoansXOffset, compLoansYOffset+i, 1, 1, 0); } Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ORPanel.java 21 Jan 2009 20:18:23 -0000 1.29 --- ORPanel.java 28 Aug 2009 20:27:38 -0000 1.30 *************** *** 418,422 **** if (hasCompanyLoans) { ! f = compLoans[i] = new Field (c.getLoanValueModel()); addField (f, loansXOffset, loansYOffset + i, 1, 1, WIDE_RIGHT); } --- 418,426 ---- if (hasCompanyLoans) { ! if (c.canLoan()) { ! f = compLoans[i] = new Field (c.getLoanValueModel()); ! } else { ! f = compLoans[i] = new Field (""); ! } addField (f, loansXOffset, loansYOffset + i, 1, 1, WIDE_RIGHT); } |
From: Erik V. <ev...@us...> - 2009-08-28 20:27:50
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29002/rails/game/specific/_1856 Modified Files: CGRFormationRound.java OperatingRound_1856.java Added Files: PublicCompany_State.java Log Message: Split off new class PublicCompany_State for 1856 CGR --- NEW FILE: PublicCompany_State.java --- package rails.game.specific._1856; import java.util.ArrayList; import java.util.List; import rails.game.*; import rails.game.move.MoveableHolderI; import rails.game.move.RemoveFromList; public class PublicCompany_State extends PublicCompany { /** Used for CGR */ private boolean hadPermanentTrain = false; public boolean hadPermanentTrain() { return hadPermanentTrain; } @Override public void buyTrain(TrainI train, int price) { super.buyTrain (train, price); if (train.getType().isPermanent()) hadPermanentTrain = true; } public void setShareUnit (int percentage) { // Only allowed for CGR, the value must be 10 if (shareUnit.intValue() == 5 && percentage == 10) { shareUnit.set(percentage); // Drop the last 10 shares List<PublicCertificateI>certs = new ArrayList<PublicCertificateI>(certificates); int share = 0; MoveableHolderI scrapHeap = Bank.getScrapHeap(); for (PublicCertificateI cert : certs) { if (share >= 100) { cert.moveTo(scrapHeap); new RemoveFromList<PublicCertificateI>(certificates, cert, "CGR_Certs"); } else { share += cert.getShare(); } } // Update all owner ShareModels (once) // to have the UI get the correct percentage List<Portfolio> done = new ArrayList<Portfolio>(); Portfolio portfolio; for (PublicCertificateI cert : certificates) { portfolio = (Portfolio)cert.getHolder(); if (!done.contains(portfolio)) { portfolio.getShareModel(this).setShare(); done.add(portfolio); } } } } } Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CGRFormationRound.java 3 Aug 2009 21:27:19 -0000 1.9 --- CGRFormationRound.java 28 Aug 2009 20:27:38 -0000 1.10 *************** *** 26,30 **** private List<ExchangeableToken> tokensToExchangeFrom = null; private List<BaseToken> nonHomeTokens = null; ! private IntegerState stepObject = new IntegerState ("CGRFormStep", 0); --- 26,30 ---- private List<ExchangeableToken> tokensToExchangeFrom = null; private List<BaseToken> nonHomeTokens = null; ! private IntegerState stepObject = new IntegerState ("CGRFormStep", 0); *************** *** 71,75 **** } } ! if (companiesToRepayLoans == null) { finishRound(); --- 71,75 ---- } } ! if (companiesToRepayLoans == null) { finishRound(); *************** *** 83,91 **** process (null); } ! private void setStep(int step) { stepObject.set(step); } ! private int getStep() { return stepObject.intValue(); --- 83,91 ---- process (null); } ! private void setStep(int step) { stepObject.set(step); } ! private int getStep() { return stepObject.intValue(); *************** *** 216,233 **** protected boolean repayLoans (RepayLoans action) { ! // TODO Validation skipped for now... MoveSet.start(true); ! PublicCompanyI company = action.getCompany(); int numberRepaid = action.getNumberRepaid(); int repayment = numberRepaid * company.getValuePerLoan(); ! if (repayment > 0) { ! int repaymentByCompany = Math.min (repayment, company.getCash()); int repaymentByPresident = repayment - repaymentByCompany; ! company.addLoans(-numberRepaid); if (repaymentByCompany > 0) { --- 216,233 ---- protected boolean repayLoans (RepayLoans action) { ! // TODO Validation skipped for now... MoveSet.start(true); ! PublicCompanyI company = action.getCompany(); int numberRepaid = action.getNumberRepaid(); int repayment = numberRepaid * company.getValuePerLoan(); ! if (repayment > 0) { ! int repaymentByCompany = Math.min (repayment, company.getCash()); int repaymentByPresident = repayment - repaymentByCompany; ! company.addLoans(-numberRepaid); if (repaymentByCompany > 0) { *************** *** 303,309 **** } } ! if (oldShares > 0) { ! count = oldShares; if (count >= 4 && temporaryPresident == null && cgrSharesUsed <= 18) { --- 303,309 ---- } } ! if (oldShares > 0) { ! count = oldShares; if (count >= 4 && temporaryPresident == null && cgrSharesUsed <= 18) { *************** *** 322,326 **** newShares++; } ! String message = LocalText.getText("HasMergedShares", player.getName(), --- 322,326 ---- newShares++; } ! String message = LocalText.getText("HasMergedShares", player.getName(), *************** *** 330,334 **** DisplayBuffer.add(message, false); ReportBuffer.add(message); ! if (count == 1) { // Should work OK even if this is a president's share. --- 330,334 ---- DisplayBuffer.add(message, false); ReportBuffer.add(message); ! if (count == 1) { // Should work OK even if this is a president's share. *************** *** 337,351 **** poolCert.moveTo(pool); certs.remove(poolCert); ! message = LocalText.getText("HasPutShareInPool", player.getName()); DisplayBuffer.add(message, false); ReportBuffer.add(message); ! } // Note: old shares are removed when company is closed ! if (firstCGRowner == null) firstCGRowner = player; ! // Check for presidency if (newShares > maxShares) { --- 337,351 ---- poolCert.moveTo(pool); certs.remove(poolCert); ! message = LocalText.getText("HasPutShareInPool", player.getName()); DisplayBuffer.add(message, false); ReportBuffer.add(message); ! } // Note: old shares are removed when company is closed ! if (firstCGRowner == null) firstCGRowner = player; ! // Check for presidency if (newShares > maxShares) { *************** *** 391,400 **** log.info(cgrSharesUsed+" CGR shares are now in play"); ! // If no more than 10 shares are in play, the CGR share // unit becomes 10%; otherwise it stays 5%. if (cgrSharesUsed <=10) { ! ((PublicCompany_1856)cgr).setShareUnit (10); ! // All superfluous shares have been removed } message = LocalText.getText("CompanyHasShares", --- 391,400 ---- log.info(cgrSharesUsed+" CGR shares are now in play"); ! // If no more than 10 shares are in play, the CGR share // unit becomes 10%; otherwise it stays 5%. if (cgrSharesUsed <=10) { ! ((PublicCompany_State)cgr).setShareUnit (10); ! // All superfluous shares have been removed } message = LocalText.getText("CompanyHasShares", *************** *** 402,406 **** DisplayBuffer.add(message); ReportBuffer.add(message); ! // Move the remaining CGR shares to the ipo. // Clone the shares list first --- 402,406 ---- DisplayBuffer.add(message); ReportBuffer.add(message); ! // Move the remaining CGR shares to the ipo. // Clone the shares list first *************** *** 512,517 **** executeExchangeTokens (nonHomeTokens); } ! ! // Determine the CGR starting price, // and close the absorbed companies. int lowestPrice = 999; --- 512,517 ---- executeExchangeTokens (nonHomeTokens); } ! ! // Determine the CGR starting price, // and close the absorbed companies. int lowestPrice = 999; *************** *** 529,534 **** numberMerged--; } ! int cgrPrice = Math.max(100, ((int)((totalPrice/numberMerged)/5))*5); ! // Find the correct start space and start the CGR if (cgrPrice == 100) { --- 529,534 ---- numberMerged--; } ! int cgrPrice = Math.max(100, (((totalPrice/numberMerged)/5))*5); ! // Find the correct start space and start the CGR if (cgrPrice == 100) { *************** *** 549,554 **** cgr.start(startSpace); message = LocalText.getText("START_MERGED_COMPANY", ! "CGR", ! Bank.format(startSpace.getPrice()), startSpace.getName()); DisplayBuffer.add(message); --- 549,554 ---- cgr.start(startSpace); message = LocalText.getText("START_MERGED_COMPANY", ! "CGR", ! Bank.format(startSpace.getPrice()), startSpace.getName()); DisplayBuffer.add(message); *************** *** 593,601 **** } } ! ! public boolean process (PossibleAction action) { ! boolean result = true; ! if (action instanceof RepayLoans) { result = repayLoans((RepayLoans)action); --- 593,602 ---- } } ! ! @Override ! public boolean process (PossibleAction action) { ! boolean result = true; ! if (action instanceof RepayLoans) { result = repayLoans((RepayLoans)action); *************** *** 606,616 **** } if (!result) return false; ! if (getStep() == STEP_REPAY_LOANS) { ! if (setNextCompanyNeedingPresidentIntervention()) { return true; } ! if (!mergingCompanies.isEmpty()) { formCGR(); --- 607,617 ---- } if (!result) return false; ! if (getStep() == STEP_REPAY_LOANS) { ! if (setNextCompanyNeedingPresidentIntervention()) { return true; } ! if (!mergingCompanies.isEmpty()) { formCGR(); *************** *** 622,626 **** } ! if (getStep() == STEP_EXCHANGE_TOKENS) { if (action instanceof ExchangeTokens) { --- 623,627 ---- } ! if (getStep() == STEP_EXCHANGE_TOKENS) { if (action instanceof ExchangeTokens) { *************** *** 632,640 **** setStep (STEP_DISCARD_TRAINS); } ! if (getStep() == STEP_DISCARD_TRAINS) { ! if (checkForTrainsToDiscard()) return true; ! //gameManager.nextRound(this); finishRound(); } --- 633,641 ---- setStep (STEP_DISCARD_TRAINS); } ! if (getStep() == STEP_DISCARD_TRAINS) { ! if (checkForTrainsToDiscard()) return true; ! //gameManager.nextRound(this); finishRound(); } *************** *** 642,647 **** return true; } ! ! private boolean checkForTrainsToDiscard () { --- 643,648 ---- return true; } ! ! private boolean checkForTrainsToDiscard () { Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** OperatingRound_1856.java 19 Jul 2009 19:24:21 -0000 1.12 --- OperatingRound_1856.java 28 Aug 2009 20:27:38 -0000 1.13 *************** *** 106,115 **** // Check if any loan interest can be paid ! int loanValue = operatingCompany.getLoanValueModel().intValue(); ! if (loanValue > 0) { ! int interest = loanValue * operatingCompany.getLoanInterestPct() / 100; ! int compCash = (operatingCompany.getCash() / 10) * 10; ! requiredCash = Math.max(interest - compCash, 0); ! } // There is only revenue if there are any trains --- 106,117 ---- // Check if any loan interest can be paid ! if (operatingCompany.canLoan()) { ! int loanValue = operatingCompany.getLoanValueModel().intValue(); ! if (loanValue > 0) { ! int interest = loanValue * operatingCompany.getLoanInterestPct() / 100; ! int compCash = (operatingCompany.getCash() / 10) * 10; ! requiredCash = Math.max(interest - compCash, 0); ! } ! } // There is only revenue if there are any trains *************** *** 141,144 **** --- 143,147 ---- int amount = action.getActualRevenue(); + if (!operatingCompany.canLoan()) return amount; int due = calculateLoanInterest(operatingCompany.getCurrentNumberOfLoans()); if (due == 0) return amount; *************** *** 192,195 **** --- 195,199 ---- int amount = action.getActualRevenue(); + if (!operatingCompany.canLoan()) return amount; int due = calculateLoanInterest(operatingCompany.getCurrentNumberOfLoans()); if (due == 0) return amount; *************** *** 407,410 **** --- 411,415 ---- if (step == STEP_REPAY_LOANS) { + // Are we // Has company any outstanding loans to repay? if (operatingCompany.getMaxNumberOfLoans() == 0 |
From: Erik V. <ev...@us...> - 2009-08-28 20:27:48
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29002/rails/game Modified Files: Phase.java PublicCompanyI.java PublicCompany.java PublicCertificate.java PublicCertificateI.java Log Message: Split off new class PublicCompany_State for 1856 CGR Index: PublicCertificate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCertificate.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PublicCertificate.java 15 Jan 2009 20:53:28 -0000 1.14 --- PublicCertificate.java 28 Aug 2009 20:27:38 -0000 1.15 *************** *** 32,36 **** protected String certId; ! /** A map alllowing to find certificates by unique id */ protected static Map<String, PublicCertificateI> certMap = new HashMap<String, PublicCertificateI>(); --- 32,36 ---- protected String certId; ! /** A map allowing to find certificates by unique id */ protected static Map<String, PublicCertificateI> certMap = new HashMap<String, PublicCertificateI>(); *************** *** 53,56 **** --- 53,62 ---- } + public PublicCertificate(PublicCertificateI oldCert) { + this.shares = oldCert.getShares(); + this.president = oldCert.isPresidentShare(); + this.initiallyAvailable = oldCert.isInitiallyAvailable(); + } + public void setUniqueId(String name, int index) { certId = name + "-" + index; *************** *** 129,133 **** } ! /** * @param b */ --- 135,143 ---- } ! public void setInitiallyAvailable(boolean initiallyAvailable) { ! this.initiallyAvailable = initiallyAvailable; ! } ! ! /** * @param b */ Index: Phase.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Phase.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Phase.java 3 Dec 2008 20:15:14 -0000 1.10 --- Phase.java 28 Aug 2009 20:27:38 -0000 1.11 *************** *** 33,36 **** --- 33,39 ---- /** May company buy more than one Train of each type from the Bank per turn? */ protected boolean oneTrainPerTypePerTurn = false; + + /** Is loan taking allowed */ + protected boolean loanTakingAllowed = false; /** Previous phase, defining the current one's defaults */ *************** *** 63,66 **** --- 66,70 ---- oneTrainPerTurn = defaults.oneTrainPerTurn; oneTrainPerTypePerTurn = defaults.oneTrainPerTypePerTurn; + loanTakingAllowed = defaults.loanTakingAllowed; if (defaults.parameters != null) { this.parameters = new HashMap<String, String>(); Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** PublicCompany.java 3 Aug 2009 21:27:19 -0000 1.50 --- PublicCompany.java 28 Aug 2009 20:27:38 -0000 1.51 *************** *** 170,173 **** --- 170,175 ---- /** The certificates of this company (minimum 1) */ protected ArrayList<PublicCertificateI> certificates; + /** Are the certificates available from the first SR? */ + boolean certsAreInitiallyAvailable = true; /** Privates and Certificates owned by the public company */ *************** *** 226,230 **** protected int maxLoansPerRound = 0; protected MoneyModel currentLoanValue = null; ! protected GameManagerI gameManager; --- 228,232 ---- protected int maxLoansPerRound = 0; protected MoneyModel currentLoanValue = null; ! protected GameManagerI gameManager; *************** *** 260,269 **** numberOfBaseTokens = tag.getAttributeAsInteger("tokens", 1); ! boolean certsAreInitiallyAvailable ! = tag.getAttributeAsBoolean("available", true); Tag shareUnitTag = tag.getChild("ShareUnit"); if (shareUnitTag != null) { ! shareUnit = new IntegerState (name+"_ShareUnit", shareUnitTag.getAttributeAsInteger("percentage", DEFAULT_SHARE_UNIT)); } --- 262,271 ---- numberOfBaseTokens = tag.getAttributeAsInteger("tokens", 1); ! certsAreInitiallyAvailable ! = tag.getAttributeAsBoolean("available", certsAreInitiallyAvailable); Tag shareUnitTag = tag.getChild("ShareUnit"); if (shareUnitTag != null) { ! shareUnit = new IntegerState (name+"_ShareUnit", shareUnitTag.getAttributeAsInteger("percentage", DEFAULT_SHARE_UNIT)); } *************** *** 614,622 **** * Final initialisation, after all XML has been processed. */ ! public void init2(GameManagerI gameManager) throws ConfigurationException { ! this.gameManager = gameManager; ! if (hasStockPrice && Util.hasValue(startSpace)) { parPrice.setPrice(StockMarket.getInstance().getStockSpace( --- 616,624 ---- * Final initialisation, after all XML has been processed. */ ! public void init2(GameManagerI gameManager) throws ConfigurationException { ! this.gameManager = gameManager; ! if (hasStockPrice && Util.hasValue(startSpace)) { parPrice.setPrice(StockMarket.getInstance().getStockSpace( *************** *** 624,633 **** if (parPrice.getPrice() == null) throw new ConfigurationException("Invalid start space " ! + startSpace + "for company " + name); currentPrice.setPrice(parPrice.getPrice()); } ! if (shareUnit == null) { shareUnit = new IntegerState (name+"_ShareUnit", DEFAULT_SHARE_UNIT); --- 626,635 ---- if (parPrice.getPrice() == null) throw new ConfigurationException("Invalid start space " ! + startSpace + " for company " + name); currentPrice.setPrice(parPrice.getPrice()); } ! if (shareUnit == null) { shareUnit = new IntegerState (name+"_ShareUnit", DEFAULT_SHARE_UNIT); *************** *** 635,640 **** // Give each certificate an unique Id for (int i = 0; i < certificates.size(); i++) { ! certificates.get(i).setUniqueId(name, i); } --- 637,646 ---- // Give each certificate an unique Id + PublicCertificateI cert; for (int i = 0; i < certificates.size(); i++) { ! cert = certificates.get(i); ! cert.setUniqueId(name, i); ! cert.setInitiallyAvailable(cert.isInitiallyAvailable() ! && this.certsAreInitiallyAvailable); } *************** *** 880,884 **** Util.moveObjects(laidBaseTokens, this); StockMarket.getInstance().close(this); ! } --- 886,890 ---- Util.moveObjects(laidBaseTokens, this); StockMarket.getInstance().close(this); ! } *************** *** 1016,1023 **** public void setCertificates(List<PublicCertificateI> list) { certificates = new ArrayList<PublicCertificateI>(); - PublicCertificateI cert2; for (PublicCertificateI cert : list) { ! cert2 = cert.copy(); ! certificates.add(cert2); } } --- 1022,1027 ---- public void setCertificates(List<PublicCertificateI> list) { certificates = new ArrayList<PublicCertificateI>(); for (PublicCertificateI cert : list) { ! certificates.add(new PublicCertificate(cert)); } } *************** *** 1652,1655 **** --- 1656,1663 ---- return maxNumberOfLoans; } + + public boolean canLoan() { + return maxNumberOfLoans > 0; + } public int getMaxLoansPerRound() { Index: PublicCertificateI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCertificateI.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PublicCertificateI.java 2 Nov 2008 19:52:48 -0000 1.9 --- PublicCertificateI.java 28 Aug 2009 20:27:38 -0000 1.10 *************** *** 19,23 **** /** * Get the number of shares that this certificate represents. ! * * @return The number of shares. */ --- 19,23 ---- /** * Get the number of shares that this certificate represents. ! * * @return The number of shares. */ *************** *** 27,31 **** * Get the percentage of ownership that this certificate represents. This is * equal to the number of shares * the share unit. ! * * @return The share percentage. */ --- 27,31 ---- * Get the percentage of ownership that this certificate represents. This is * equal to the number of shares * the share unit. ! * * @return The share percentage. */ *************** *** 34,42 **** /** * Get the current price of this certificate. ! * * @return The current certificate price. */ //public int getCertificatePrice(); /** * @param b --- 34,43 ---- /** * Get the current price of this certificate. ! * * @return The current certificate price. */ //public int getCertificatePrice(); + public void setInitiallyAvailable(boolean initiallyAvailable); /** * @param b *************** *** 71,75 **** /** * Compare certificates ! * * @param cert Another publoc certificate. * @return TRUE if the certificates are of the same company and represent --- 72,76 ---- /** * Compare certificates ! * * @param cert Another publoc certificate. * @return TRUE if the certificates are of the same company and represent Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** PublicCompanyI.java 24 Jan 2009 15:10:26 -0000 1.28 --- PublicCompanyI.java 28 Aug 2009 20:27:38 -0000 1.29 *************** *** 332,335 **** --- 332,336 ---- public int getLoanInterestPct(); public int getMaxNumberOfLoans(); + public boolean canLoan(); public int getMaxLoansPerRound(); public int getValuePerLoan(); |
From: Erik V. <ev...@us...> - 2009-08-28 20:27:47
|
Update of /cvsroot/rails/18xx/data/1856 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29002/data/1856 Modified Files: CompanyManager.xml Log Message: Split off new class PublicCompany_State for 1856 CGR Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/CompanyManager.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CompanyManager.xml 4 May 2009 20:29:15 -0000 1.25 --- CompanyManager.xml 28 Aug 2009 20:27:38 -0000 1.26 *************** *** 17,20 **** --- 17,30 ---- <!-- Number of loans is undefined and handled in the code --> </CompanyType> + <CompanyType name="State" class="rails.game.specific._1856.PublicCompany_State"> + <PoolPaysOut/> + <ShareUnit percentage="5"/> + <Certificate type="President" shares="2"/> + <Certificate shares="1" number="18"/> + <BaseTokens> + <LayCost method="sequence" cost="0,40,100"/> + </BaseTokens> + <Trains number="0,0,0,3"/> + </CompanyType> <Company name="Flos" type="Private" basePrice="20" revenue="5"> *************** *** 97,106 **** <Destination hex="H15"/> </Company> ! <Company name="CGR" type="Public" available="no" tokens="10" fgColour="FFFFFF" bgColour="000000"> ! <!-- Initially 20 shares are configured--> ! <ShareUnit percentage="5"/> ! <Trains number="0,0,0,3"/> ! <Certificate type="President" shares="2"/> ! <Certificate shares="1" number="18"/> </Company> <Company name="TGB" type="Public" tokens="2" fgColour="FFFFFF" bgColour="FF8000"> --- 107,111 ---- <Destination hex="H15"/> </Company> ! <Company name="CGR" type="State" available="no" tokens="10" fgColour="FFFFFF" bgColour="000000"> </Company> <Company name="TGB" type="Public" tokens="2" fgColour="FFFFFF" bgColour="FF8000"> |
From: Erik V. <ev...@us...> - 2009-08-28 20:25:39
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv28875/rails/game Modified Files: Game.java Log Message: Minor change in initialisation sequence Index: Game.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Game.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Game.java 4 May 2009 20:29:14 -0000 1.22 --- Game.java 28 Aug 2009 20:25:28 -0000 1.23 *************** *** 2,5 **** --- 2,8 ---- package rails.game; + import java.io.*; + import java.util.*; + import org.apache.log4j.Logger; *************** *** 8,16 **** import rails.util.Tag; - import java.io.File; - import java.io.FileInputStream; - import java.io.ObjectInputStream; - import java.util.*; - public class Game { public static final String version = "1.0.5"; --- 11,14 ---- *************** *** 66,70 **** public void start() { ! gameManager.startGame(playerManager, companyManager, phaseManager, trainManager); } --- 64,68 ---- public void start() { ! gameManager.startGame(playerManager, companyManager, phaseManager, trainManager); } *************** *** 143,149 **** * only be done after all XML has been processed. */ bank.initCertificates(); StartPacket.init(); ! companyManager.initCompanies(gameManager); stockMarket.init(); } catch (Exception e) { --- 141,148 ---- * only be done after all XML has been processed. */ + companyManager.initCompanies(gameManager); bank.initCertificates(); StartPacket.init(); ! //companyManager.initCompanies(gameManager); stockMarket.init(); } catch (Exception e) { *************** *** 255,259 **** return instance.playerManager; } ! public GameManagerI getGameManager() { return gameManager; --- 254,258 ---- return instance.playerManager; } ! public GameManagerI getGameManager() { return gameManager; |