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: Stefan F. <ste...@us...> - 2010-02-24 21:10:11
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31633/rails/game Modified Files: OperatingRound.java Log Message: Changed base class of ClosePrivate and OperatingCost actions to PossibleAction and PossibleOR in preparation of new Correction Actions Breaks save compatibility with previous actions. Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** OperatingRound.java 23 Feb 2010 22:21:39 -0000 1.106 --- OperatingRound.java 24 Feb 2010 21:09:23 -0000 1.107 *************** *** 198,204 **** result = buyBonusToken((BuyBonusToken) selectedAction); ! } else if (selectedAction instanceof CorrectCashI) { ! // includes OperatingCost ! result = executeCorrectCash((CorrectCashI) selectedAction); } else if (selectedAction instanceof SetDividend) { --- 198,204 ---- result = buyBonusToken((BuyBonusToken) selectedAction); ! } else if (selectedAction instanceof OperatingCost) { ! ! result = executeOperatingCost((OperatingCost) selectedAction); } else if (selectedAction instanceof SetDividend) { *************** *** 942,981 **** } ! protected boolean executeCorrectCash(CorrectCashI action){ ! CashHolder ch = action.getCashHolder(); ! int amount = action.getAmount(); ! int cost = -amount; // costs are minus of CashCorrectamount ! // operating costs related stuff ! boolean flagOC = false; ! OperatingCost actionOC = null; ! OperatingCost.OCType typeOC = null; ! PublicCompanyI pc = null; ! String textError = "CCExecutionError"; ! ! if (action instanceof OperatingCost) { ! flagOC = true; ! actionOC = (OperatingCost) action; ! typeOC = actionOC.getOCType(); ! pc = (PublicCompanyI) ch; ! textError = "OCExecutionError"; ! } String errMsg = null; while (true) { ! if ((amount + ch.getCash()) < 0) { errMsg = LocalText.getText("NotEnoughMoney", ! ch.getName(), ! Bank.format(ch.getCash()), ! Bank.format(cost) ); break; } ! if (flagOC && (typeOC == OperatingCost.OCType.LAY_BASE_TOKEN) && (pc.getNumberOfFreeBaseTokens() == 0)) { errMsg = ! LocalText.getText("HasNoTokensLeft", ch.getName()); break; } --- 942,976 ---- } ! protected boolean executeOperatingCost(OperatingCost action){ ! String companyName = action.getCompanyName(); ! OperatingCost.OCType typeOC = action.getOCType(); ! int amount = action.getAmount(); String errMsg = null; while (true) { ! // Must be correct company. ! if (!companyName.equals(operatingCompany.getName())) { ! errMsg = ! LocalText.getText("WrongCompany", ! companyName, ! operatingCompany.getName() ); ! break; ! } ! // amount is available ! if ((amount + operatingCompany.getCash()) < 0) { errMsg = LocalText.getText("NotEnoughMoney", ! companyName, ! Bank.format(operatingCompany.getCash()), ! Bank.format(amount) ); break; } ! if (typeOC == OperatingCost.OCType.LAY_BASE_TOKEN && operatingCompany.getNumberOfFreeBaseTokens() == 0) { errMsg = ! LocalText.getText("HasNoTokensLeft", companyName); break; } *************** *** 984,989 **** if (errMsg != null) { ! DisplayBuffer.add(LocalText.getText(textError, ! ch.getName(), errMsg)); return false; --- 979,984 ---- if (errMsg != null) { ! DisplayBuffer.add(LocalText.getText("OCExecutionError", ! companyName, errMsg)); return false; *************** *** 992,1025 **** moveStack.start(true); ! if (amount < 0) { ! // negative amounts: remove cash from cashholder ! new CashMove(ch, bank, cost); } else if (amount > 0) { ! // positive amounts: add cash to cashholder ! new CashMove(bank, ch, amount); } ! if (flagOC) { ! ! if (typeOC == OperatingCost.OCType.LAY_TILE) { ! pc.layTileInNoMapMode(cost); ! ReportBuffer.add(LocalText.getText("OCLayTileExecuted", ! pc.getName(), ! Bank.format(cost) )); ! } ! if (typeOC == OperatingCost.OCType.LAY_BASE_TOKEN) { ! // move token to Bank ! BaseToken token = pc.getFreeToken(); ! if (token == null) { ! log.error("Company " + pc.getName() + " has no free token"); ! return false; ! } else { ! token.moveTo(bank.getUnavailable()); ! } ! pc.layBaseTokenInNoMapMode(cost); ! ReportBuffer.add(LocalText.getText("OCLayBaseTokenExecuted", ! pc.getName(), ! Bank.format(cost) )); } } --- 987,1017 ---- moveStack.start(true); ! if (amount > 0) { ! // positive amounts: remove cash from cashholder ! new CashMove(operatingCompany, bank, amount); } else if (amount > 0) { ! // negative amounts: add cash to cashholder ! new CashMove(bank, operatingCompany, -amount); } ! if (typeOC == OperatingCost.OCType.LAY_TILE) { ! operatingCompany.layTileInNoMapMode(amount); ! ReportBuffer.add(LocalText.getText("OCLayTileExecuted", ! operatingCompany.getName(), ! Bank.format(amount) )); ! } ! if (typeOC == OperatingCost.OCType.LAY_BASE_TOKEN) { ! // move token to Bank ! BaseToken token = operatingCompany.getFreeToken(); ! if (token == null) { ! log.error("Company " + operatingCompany.getName() + " has no free token"); ! return false; ! } else { ! token.moveTo(bank.getUnavailable()); } + operatingCompany.layBaseTokenInNoMapMode(amount); + ReportBuffer.add(LocalText.getText("OCLayBaseTokenExecuted", + operatingCompany.getName(), + Bank.format(amount) )); } *************** *** 1047,1050 **** --- 1039,1128 ---- return true; } + + // protected boolean executeCorrectCash(CorrectCashI action){ + // + // CashHolder ch = action.getCashHolder(); + // int amount = action.getAmount(); + // int cost = -amount; // costs are minus of CashCorrectamount + // + // // operating costs related stuff + // boolean flagOC = false; + // OperatingCost actionOC = null; + // OperatingCost.OCType typeOC = null; + // PublicCompanyI pc = null; + // String textError = "CCExecutionError"; + // + // if (action instanceof OperatingCost) { + // flagOC = true; + // actionOC = (OperatingCost) action; + // typeOC = actionOC.getOCType(); + // pc = (PublicCompanyI) ch; + // textError = "OCExecutionError"; + // } + // + // String errMsg = null; + // + // while (true) { + // if ((amount + ch.getCash()) < 0) { + // errMsg = + // LocalText.getText("NotEnoughMoney", + // ch.getName(), + // Bank.format(ch.getCash()), + // Bank.format(cost) + // ); + // break; + // } + // if (flagOC && (typeOC == OperatingCost.OCType.LAY_BASE_TOKEN) && (pc.getNumberOfFreeBaseTokens() == 0)) { + // errMsg = + // LocalText.getText("HasNoTokensLeft", ch.getName()); + // break; + // } + // break; + // } + // + // if (errMsg != null) { + // DisplayBuffer.add(LocalText.getText(textError, + // ch.getName(), + // errMsg)); + // return false; + // } + // + // moveStack.start(true); + // + // if (amount < 0) { + // // negative amounts: remove cash from cashholder + // new CashMove(ch, bank, cost); + // } else if (amount > 0) { + // // positive amounts: add cash to cashholder + // new CashMove(bank, ch, amount); + // } + // + // if (flagOC) { + // + // if (typeOC == OperatingCost.OCType.LAY_TILE) { + // pc.layTileInNoMapMode(cost); + // ReportBuffer.add(LocalText.getText("OCLayTileExecuted", + // pc.getName(), + // Bank.format(cost) )); + // } + // if (typeOC == OperatingCost.OCType.LAY_BASE_TOKEN) { + // // move token to Bank + // BaseToken token = pc.getFreeToken(); + // if (token == null) { + // log.error("Company " + pc.getName() + " has no free token"); + // return false; + // } else { + // token.moveTo(bank.getUnavailable()); + // } + // pc.layBaseTokenInNoMapMode(cost); + // ReportBuffer.add(LocalText.getText("OCLayBaseTokenExecuted", + // pc.getName(), + // Bank.format(cost) )); + // } + // } + // + // return true; + // } + /** *************** *** 2249,2255 **** for (Integer tc: mapManager.getPossibleTileCosts()) { if (tc <= operatingCompany.getCash()) ! possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_TILE, tc, false ! )); } --- 2327,2331 ---- for (Integer tc: mapManager.getPossibleTileCosts()) { if (tc <= operatingCompany.getCash()) ! possibleActions.add(new OperatingCost(OperatingCost.OCType.LAY_TILE, tc, false)); } *************** *** 2259,2266 **** for (int cost : costs) { if ((cost <= operatingCompany.getCash()) && (cost != 0 || costs.length == 1)) // distance method returns home base, but in sequence costs can be zero ! possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, ! cost, false ! )); } } --- 2335,2339 ---- for (int cost : costs) { if ((cost <= operatingCompany.getCash()) && (cost != 0 || costs.length == 1)) // distance method returns home base, but in sequence costs can be zero ! possibleActions.add(new OperatingCost(OperatingCost.OCType.LAY_BASE_TOKEN, cost, false)); } } *************** *** 2268,2278 **** // Default OperatingCost Actions possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_TILE, 0, true )); if (operatingCompany.getNumberOfFreeBaseTokens() != 0 && operatingCompany.getBaseTokenLayCost(null) != 0) { ! possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, 0, true ! )); } --- 2341,2349 ---- // Default OperatingCost Actions possibleActions.add(new OperatingCost( ! OperatingCost.OCType.LAY_TILE, 0, true )); if (operatingCompany.getNumberOfFreeBaseTokens() != 0 && operatingCompany.getBaseTokenLayCost(null) != 0) { ! possibleActions.add(new OperatingCost(OperatingCost.OCType.LAY_BASE_TOKEN, 0, true)); } |
From: Stefan F. <ste...@us...> - 2010-02-24 21:10:01
|
Update of /cvsroot/rails/18xx/rails/game/correct In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31633/rails/game/correct Modified Files: OperatingCost.java ClosePrivate.java Log Message: Changed base class of ClosePrivate and OperatingCost actions to PossibleAction and PossibleOR in preparation of new Correction Actions Breaks save compatibility with previous actions. Index: ClosePrivate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/ClosePrivate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClosePrivate.java 22 Feb 2010 22:48:18 -0000 1.2 --- ClosePrivate.java 24 Feb 2010 21:09:22 -0000 1.3 *************** *** 9,18 **** /** ! * Correction action that allows the closure of a private company. */ ! public class ClosePrivate extends CorrectionAction { ! private static final long serialVersionUID = 1L; /* Preconditions */ --- 9,19 ---- /** ! * Action that allows the closure of a private company ! * used for NoMapMode */ ! public class ClosePrivate extends PossibleAction { ! private static final long serialVersionUID = 2L; /* Preconditions */ *************** *** 46,52 **** if (!(action instanceof ClosePrivate)) return false; ClosePrivate a = (ClosePrivate) action; ! return (a.privateCompany == this.privateCompany && ! a.inCorrectionMenu == this.inCorrectionMenu ! ); } --- 47,51 ---- if (!(action instanceof ClosePrivate)) return false; ClosePrivate a = (ClosePrivate) action; ! return (a.privateCompany == this.privateCompany); } *************** *** 58,62 **** if (privateCompany != null) b.append(", privateCompany="+privateCompany); - b.append(", inCorrectionMenu="+inCorrectionMenu); } else { b.append(" (acted)"); --- 57,60 ---- Index: OperatingCost.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/OperatingCost.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OperatingCost.java 22 Feb 2010 22:48:18 -0000 1.4 --- OperatingCost.java 24 Feb 2010 21:09:19 -0000 1.5 *************** *** 3,6 **** --- 3,7 ---- import rails.game.*; import rails.game.action.PossibleAction; + import rails.game.action.PossibleORAction; import rails.util.Util; *************** *** 9,30 **** /** ! * Correction action that mirrors operating actions like tile and token lays, but ! * only changes the cash position of a cashholder. * @author Stefan Frey */ ! public class OperatingCost extends CorrectionAction implements CorrectCashI { public enum OCType {LAY_TILE, LAY_BASE_TOKEN}; /** The Constant serialVersionUID. */ ! public static final long serialVersionUID = 1L; /* Preconditions */ - - /** operating Company */ - transient private PublicCompanyI operatingCompany; - - /** converted to name */ - private String operatingCompanyName; /** operating cost type (as tile lay, token lay etc.) */ --- 10,26 ---- /** ! * OR action for no map mode ! * mirrors operating actions like tile and token lays, but ! * only changes the cash position of the public company * @author Stefan Frey */ ! public class OperatingCost extends PossibleORAction { public enum OCType {LAY_TILE, LAY_BASE_TOKEN}; /** The Constant serialVersionUID. */ ! public static final long serialVersionUID = 2L; /* Preconditions */ /** operating cost type (as tile lay, token lay etc.) */ *************** *** 50,68 **** * @param pc Public Company */ ! public OperatingCost(PublicCompanyI pc, OCType ot, int ocCosts, boolean freeEntry) { ! operatingCompany = pc; ! operatingCompanyName = pc.getName(); operatingCostType = ot; suggestedCost = ocCosts; freeEntryAllowed = freeEntry; ! maximumCost = pc.getCash(); ! } ! ! public CashHolder getCashHolder() { ! return operatingCompany; ! } ! ! public String getCashHolderName() { ! return operatingCompanyName; } --- 46,57 ---- * @param pc Public Company */ ! public OperatingCost(OCType ot, int ocCosts, boolean freeEntry) { ! ! super(); ! operatingCostType = ot; suggestedCost = ocCosts; freeEntryAllowed = freeEntry; ! maximumCost = company.getCash(); } *************** *** 73,77 **** public int getAmount() { if (acted) ! return -operatingCost; else return suggestedCost; --- 62,66 ---- public int getAmount() { if (acted) ! return operatingCost; else return suggestedCost; *************** *** 90,98 **** if (!(action instanceof OperatingCost)) return false; OperatingCost a = (OperatingCost) action; ! return (a.operatingCompany == this.operatingCompany && a.operatingCostType == this.operatingCostType && a.suggestedCost == this.suggestedCost && ! a.maximumCost == this.maximumCost && ! a.inCorrectionMenu == this.inCorrectionMenu ); } --- 79,86 ---- if (!(action instanceof OperatingCost)) return false; OperatingCost a = (OperatingCost) action; ! return (a.company == this.company && a.operatingCostType == this.operatingCostType && a.suggestedCost == this.suggestedCost && ! a.maximumCost == this.maximumCost ); } *************** *** 102,115 **** if (!acted) { b.append(" (not acted)"); ! if (operatingCompany != null) ! b.append(", operatingCompany="+operatingCompany); b.append(", operatingCostType="+operatingCostType); b.append(", suggestedCost="+suggestedCost); b.append(", maximumCost="+maximumCost); - b.append(", inCorrectionMenu="+inCorrectionMenu); } else { b.append(" (acted)"); ! if (operatingCompany != null) ! b.append(", operatingCompany="+operatingCompany); b.append(", operatingCostType="+operatingCostType); b.append(", operatingCost="+operatingCost); --- 90,102 ---- if (!acted) { b.append(" (not acted)"); ! if (company != null) ! b.append(", company="+company); b.append(", operatingCostType="+operatingCostType); b.append(", suggestedCost="+suggestedCost); b.append(", maximumCost="+maximumCost); } else { b.append(" (acted)"); ! if (company != null) ! b.append(", company="+company); b.append(", operatingCostType="+operatingCostType); b.append(", operatingCost="+operatingCost); *************** *** 122,127 **** ClassNotFoundException { in.defaultReadObject(); ! if (Util.hasValue(operatingCompanyName)) ! operatingCompany = getCompanyManager().getCompanyByName(operatingCompanyName); } } --- 109,114 ---- ClassNotFoundException { in.defaultReadObject(); ! if (Util.hasValue(companyName)) ! company = getCompanyManager().getCompanyByName(companyName); } } |
From: Stefan F. <ste...@us...> - 2010-02-24 21:09:45
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31633/rails/ui/swing Modified Files: ORUIManager.java Log Message: Changed base class of ClosePrivate and OperatingCost actions to PossibleAction and PossibleOR in preparation of new Correction Actions Breaks save compatibility with previous actions. Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** ORUIManager.java 23 Feb 2010 21:07:34 -0000 1.57 --- ORUIManager.java 24 Feb 2010 21:09:33 -0000 1.58 *************** *** 1390,1395 **** if (possibleActions.contains(ClosePrivate.class)) { for (ClosePrivate action: possibleActions.getType(ClosePrivate.class)) { ! if (!action.isInCorrectionMenu()) ! orPanel.addSpecialAction(action, action.getInfo()); } } --- 1390,1394 ---- if (possibleActions.contains(ClosePrivate.class)) { for (ClosePrivate action: possibleActions.getType(ClosePrivate.class)) { ! orPanel.addSpecialAction(action, action.getInfo()); } } |
From: Stefan F. <ste...@us...> - 2010-02-24 18:08:57
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5650/rails/game Modified Files: StockRound.java Log Message: Fixed stock round undo bug (ID: 2954657) Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** StockRound.java 17 Feb 2010 22:01:44 -0000 1.63 --- StockRound.java 24 Feb 2010 18:08:36 -0000 1.64 *************** *** 95,98 **** --- 95,101 ---- public boolean setPossibleActions() { + // fix of the forced undo bug + currentPlayer = getCurrentPlayer(); + boolean passAllowed = false; |
From: Stefan F. <ste...@us...> - 2010-02-23 22:38:08
|
Update of /cvsroot/rails/18xx/data/1889 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31766/data/1889 Modified Files: Game.xml Log Message: Activated third OffBoardRevenueStep Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/Game.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Game.xml 23 Feb 2010 22:21:39 -0000 1.7 --- Game.xml 23 Feb 2010 22:38:01 -0000 1.8 *************** *** 129,134 **** <Phase name="D"> <Tiles colour="yellow,green,brown"/> ! <!-- TODO: Offboard revenue only for diesels changes, other trains remain at step 2 --> ! <!-- <OffBoardRevenue step="3"/> --> </Phase> </Component> --- 129,135 ---- <Phase name="D"> <Tiles colour="yellow,green,brown"/> ! <!-- TODO: Offboard revenue only for diesels changes, other trains remain at step 2, ! but not relevant as long as revenue calculation is not supported. --> ! <OffBoardRevenue step="3"/> </Phase> </Component> |
From: Stefan F. <ste...@us...> - 2010-02-23 22:21:48
|
Update of /cvsroot/rails/18xx/data In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29490/data Modified Files: GamesList.xml Log Message: Added better support for B and C privates Minor fix to boolean conversion of GameOptions Index: GamesList.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/GamesList.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** GamesList.xml 20 Feb 2010 12:34:29 -0000 1.27 --- GamesList.xml 23 Feb 2010 22:21:40 -0000 1.28 *************** *** 93,105 **** <Game name="1889"> ! <Note>Fully playable (see Description)</Note> <Description>1889 - History of Shikoku Railways (c) 2003-2006 Yasutaka Ikeda Published by Wild Heaven Productions and Deep Thought Games ! Limitations: ! - Private B: Building of Port tile only possible at the tile laying step of a public company with the same owner. ! - Private C: Laying of green tile on C4 only possible at the tile laying step of the new company owner, not immediately after sale by ! selling player. - Forced Selling: Change of director in other company is not prevented by Rails (see rule 10.6.2) </Description> --- 93,102 ---- <Game name="1889"> ! <Note>Fully playable</Note> <Description>1889 - History of Shikoku Railways (c) 2003-2006 Yasutaka Ikeda Published by Wild Heaven Productions and Deep Thought Games ! Limitation: - Forced Selling: Change of director in other company is not prevented by Rails (see rule 10.6.2) </Description> |
From: Stefan F. <ste...@us...> - 2010-02-23 22:21:48
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29490/rails/game Modified Files: OperatingRound.java GameOption.java GameManager.java Log Message: Added better support for B and C privates Minor fix to boolean conversion of GameOptions Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** OperatingRound.java 22 Feb 2010 22:48:18 -0000 1.105 --- OperatingRound.java 23 Feb 2010 22:21:39 -0000 1.106 *************** *** 97,101 **** // sfy NoMapMode ! noMapMode = GameOption.convertValueToBoolean("NoMapMode", getGameOption("NoMapMode")); guiHints.setVisibilityHint(GuiDef.Panel.STOCK_MARKET, false); --- 97,101 ---- // sfy NoMapMode ! noMapMode = GameOption.convertValueToBoolean(getGameOption("NoMapMode")); guiHints.setVisibilityHint(GuiDef.Panel.STOCK_MARKET, false); Index: GameOption.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameOption.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GameOption.java 14 Feb 2010 20:48:02 -0000 1.10 --- GameOption.java 23 Feb 2010 22:21:39 -0000 1.11 *************** *** 103,109 **** /** Get GameOption Value as Boolean Value */ ! public static boolean convertValueToBoolean(String name, String value) { return value != null - && optionsMap.get(name).isBoolean && OPTION_VALUE_YES.equalsIgnoreCase(value); } --- 103,108 ---- /** Get GameOption Value as Boolean Value */ ! public static boolean convertValueToBoolean(String value) { return value != null && OPTION_VALUE_YES.equalsIgnoreCase(value); } Index: GameManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameManager.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** GameManager.java 17 Feb 2010 00:22:15 -0000 1.83 --- GameManager.java 23 Feb 2010 22:21:39 -0000 1.84 *************** *** 492,496 **** } ! if (GameOption.convertValueToBoolean("NoMapMode", getGameOption("NoMapMode"))) guiParameters.put(GuiDef.Parm.NO_MAP_MODE, true); --- 492,496 ---- } ! if (GameOption.convertValueToBoolean(getGameOption("NoMapMode"))) guiParameters.put(GuiDef.Parm.NO_MAP_MODE, true); |
From: Stefan F. <ste...@us...> - 2010-02-23 22:21:48
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29490 Modified Files: LocalisedText.properties Log Message: Added better support for B and C privates Minor fix to boolean conversion of GameOptions Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** LocalisedText.properties 16 Feb 2010 20:19:47 -0000 1.111 --- LocalisedText.properties 23 Feb 2010 22:21:40 -0000 1.112 *************** *** 1,3 **** --- 1,5 ---- # Texts with lowercase keys are intended to be inserted into other messages + 1889PrivateBactive=Player {0} (owner of Private B) may lay port tile + 1889PrivateCactive=Player {0} (previous owner of Private C) may lay tile on C4 immediately ActionNotAllowed=Action {0} is not allowed ALL=All |
From: Stefan F. <ste...@us...> - 2010-02-23 22:21:48
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1889 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29490/rails/game/specific/_1889 Added Files: OperatingRound_1889.java Log Message: Added better support for B and C privates Minor fix to boolean conversion of GameOptions --- NEW FILE: OperatingRound_1889.java --- /* $Header: /cvsroot/rails/18xx/rails/game/specific/_1889/OperatingRound_1889.java,v 1.1 2010/02/23 22:21:40 stefanfrey Exp $ */ package rails.game.specific._1889; import rails.game.*; import rails.game.action.*; import rails.game.special.*; import rails.game.state.*; import rails.util.*; /** * Adds specific code for 1889 to allow the special timing of the special tile laying private companies */ public class OperatingRound_1889 extends OperatingRound { private PrivateCompanyI privB; private BooleanState activeSpPrivB; private PrivateCompanyI privC; private BooleanState activeSpPrivC; private GameDef.OrStep storeActiveStep; private String previousOwnerName; private boolean beginnerGame; /** * Instantiates a new operating round_1889. * * @param gameManager the game manager */ public OperatingRound_1889 (GameManagerI gameManager) { super (gameManager); privB = companyManager.getPrivateCompany("B"); activeSpPrivB = new BooleanState("ActiveSpPrivB", false); privC = companyManager.getPrivateCompany("C"); activeSpPrivC = new BooleanState("ActiveSpPrivC", false); beginnerGame = GameOption.convertValueToBoolean(getGameOption("BeginnerGame")); } @Override protected void setGameSpecificPossibleActions() { // noMapMode and beginnerGame are not effected if (noMapMode || beginnerGame) return; // private B: lay track at other company tile laying steps if (getStep() == GameDef.OrStep.LAY_TRACK) { if (!privB.isClosed() && privB.getPortfolio().getOwner() instanceof Player && privB.getPortfolio().getOwner() != operatingCompany.getPresident()) { SpecialPropertyI spPrivB = privB.getSpecialProperties().get(0); if (spPrivB != null && !spPrivB.isExercised()) { if (!activeSpPrivB.booleanValue()) possibleActions.add(new UseSpecialProperty(spPrivB)); else { possibleActions.add(new LayTile((SpecialTileLay)spPrivB)); DisplayBuffer.add(LocalText.getText("1889PrivateBactive", privB.getPortfolio().getOwner())); } } } } else { activeSpPrivB.set(false); } // private C: trigger by purchase of private -- see below if (activeSpPrivC.booleanValue()) { possibleActions.clear(); SpecialTileLay spPrivC = (SpecialTileLay)privC.getSpecialProperties().get(0); possibleActions.add(new LayTile(spPrivC)); possibleActions.add(new NullAction(NullAction.SKIP)); DisplayBuffer.add(LocalText.getText("1889PrivateCactive", previousOwnerName)); } } @Override public boolean processGameSpecificAction(PossibleAction action) { // private B if (action instanceof UseSpecialProperty) { UseSpecialProperty spAction=(UseSpecialProperty)action; if (spAction.getSpecialProperty() == privB.getSpecialProperties().get(0)) { moveStack.start(true); activeSpPrivB.set(true); log.debug("1889 specific: Allows tile lay for B with player request"); return true; } } return false; } @Override public boolean buyPrivate(BuyPrivate action){ // store the seller name, playername in action is the owner of the buying company! String sellerName = action.getPrivateCompany().getPortfolio().getOwner().getName(); boolean result = super.buyPrivate(action); if (!(noMapMode || beginnerGame) && result && (action.getPrivateCompany() == privC)) { // moveStack identical to buy private action activeSpPrivC.set(true); previousOwnerName = sellerName; log.debug("1889 specific: Activates tile laying step for C after purchase of C"); storeActiveStep = getStep(); stepObject.set(GameDef.OrStep.LAY_TRACK); } return result; } @Override public boolean layTile(LayTile action) { boolean result = super.layTile(action); if (result && activeSpPrivC.booleanValue()) { // moveStack identical to tile lay log.debug("1889 specific: Tile lay for C executed, return to previous step"); activeSpPrivC.set(false); stepObject.set(storeActiveStep); } return(result); } @Override public void skip() { if (activeSpPrivC.booleanValue()) { log.debug("1889 specific: Tile lay for C skipped, return to previous step"); moveStack.start(true); activeSpPrivC.set(false); stepObject.set(storeActiveStep); } else { super.skip(); } } } |
From: Stefan F. <ste...@us...> - 2010-02-23 22:21:48
|
Update of /cvsroot/rails/18xx/data/1889 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29490/data/1889 Modified Files: Game.xml CompanyManager.xml Log Message: Added better support for B and C privates Minor fix to boolean conversion of GameOptions Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/CompanyManager.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.3 --- CompanyManager.xml 23 Feb 2010 22:21:39 -0000 1.4 *************** *** 50,61 **** <Company name="B" type="Private" basePrice="30" revenue="5" longName="Mitsubishi Ferry"> <SpecialProperties> <SpecialProperty condition="ifOwnedByPlayer" when="tileLayingStep" class="rails.game.special.SpecialTileLay"> <SpecialTileLay location="B11,G10,I12,J9" tile="437" extra="yes" free="yes"/> </SpecialProperty> - <!-- TODO: Additional Property required: --> - <!-- <SpecialProperty condition="ifOwnedByPlayer" when="betweenOR" class="rails.game.special.SpecialTileLay"> - <SpecialTileLay location="B11,G10,I12,J9" tile="437" extra="yes" free="yes"/> - </SpecialProperty> --> </SpecialProperties> </Company> --- 50,58 ---- <Company name="B" type="Private" basePrice="30" revenue="5" longName="Mitsubishi Ferry"> + <!-- Handling of special property outside of players public company turn is done in OperatingRound_1889, coded against name "B" --> <SpecialProperties> <SpecialProperty condition="ifOwnedByPlayer" when="tileLayingStep" class="rails.game.special.SpecialTileLay"> <SpecialTileLay location="B11,G10,I12,J9" tile="437" extra="yes" free="yes"/> </SpecialProperty> </SpecialProperties> </Company> *************** *** 64,74 **** <Blocking hex="C4"/> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" when="tileLayingStep" class="rails.game.special.SpecialTileLay"> <SpecialTileLay location="C4" extra="yes" free="yes"/> </SpecialProperty> - <!-- TODO: Correct Property would look like: --> - <!-- <SpecialProperty condition="PlayerAfterSellToPublic" when="immediate" class="rails.game.special.SpecialTileLay"> - <SpecialTileLay location="C4" extra="yes" free="yes"/> - </SpecialProperty>--> </SpecialProperties> </Company> --- 61,68 ---- <Blocking hex="C4"/> <SpecialProperties> ! <!-- Timing of special property is done in OperatingRound_1889, coded against name "C" --> ! <SpecialProperty condition="specific" when="tileLayingStep" class="rails.game.special.SpecialTileLay"> <SpecialTileLay location="C4" extra="yes" free="yes"/> </SpecialProperty> </SpecialProperties> </Company> Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/Game.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Game.xml 17 Feb 2010 00:34:52 -0000 1.6 --- Game.xml 23 Feb 2010 22:21:39 -0000 1.7 *************** *** 32,35 **** --- 32,36 ---- <NoSaleInFirstSR/> </StockRound> + <OperatingRound class="rails.game.specific._1889.OperatingRound_1889"/> </GameParameters> <EndOfGame> |
From: Stefan F. <ste...@us...> - 2010-02-23 22:21:32
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1889 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29480/rails/game/specific/_1889 Log Message: Directory /cvsroot/rails/18xx/rails/game/specific/_1889 added to the repository |
From: Erik V. <ev...@us...> - 2010-02-23 21:08:11
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18AL In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19449/rails/ui/swing/gamespecific/_18AL Modified Files: ORUIManager_18AL.java Log Message: Removed redundant (duplicate) Special menu assignment Index: ORUIManager_18AL.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18AL/ORUIManager_18AL.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ORUIManager_18AL.java 4 Jun 2008 19:00:40 -0000 1.2 --- ORUIManager_18AL.java 23 Feb 2010 21:08:03 -0000 1.3 *************** *** 9,12 **** --- 9,13 ---- public class ORUIManager_18AL extends ORUIManager { + /* @Override protected void checkForGameSpecificActions() { *************** *** 21,24 **** --- 22,26 ---- } } + */ protected boolean processGameSpecificActions(List<PossibleAction> actions) { |
From: Erik V. <ev...@us...> - 2010-02-23 21:07:49
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19359/rails/ui/swing Modified Files: ORUIManager.java Log Message: Changed comment Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** ORUIManager.java 22 Feb 2010 22:48:20 -0000 1.56 --- ORUIManager.java 23 Feb 2010 21:07:34 -0000 1.57 *************** *** 1379,1383 **** // Any other special properties, to be shown in the "Special" menu. ! // (Currently not used) if (possibleActions.contains(UseSpecialProperty.class)) { for (UseSpecialProperty usp : possibleActions.getType(UseSpecialProperty.class)) { --- 1379,1383 ---- // Any other special properties, to be shown in the "Special" menu. ! // Example: 18AL AssignNamedTrains if (possibleActions.contains(UseSpecialProperty.class)) { for (UseSpecialProperty usp : possibleActions.getType(UseSpecialProperty.class)) { |
From: Erik V. <ev...@us...> - 2010-02-22 23:19:22
|
Update of /cvsroot/rails/18xx/data/18AL In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27251/data/18AL Modified Files: CompanyManager.xml Log Message: 18AL longnames Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18AL/CompanyManager.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.27 --- CompanyManager.xml 22 Feb 2010 23:19:09 -0000 1.28 *************** *** 16,88 **** <CanUseSpecialProperties/> </CompanyType> ! <Company name="Tusc" type="Private" basePrice="20" revenue="5"/> ! <Company name="S&NA" type="Private" basePrice="40" revenue="10"> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" ! when="anyTimeDuringORTurn" class="rails.game.special.SpecialTokenLay"> ! <SpecialTokenLay class="rails.game.BonusToken" ! location="E6,G4,G6,H3,H5" connected="yes" extra="yes"> ! <BonusToken name="Coalfield" value="10" removed="Phase:6"/> </SpecialTokenLay> </SpecialProperty> </SpecialProperties> </Company> ! <Company name="B&SLC" type="Private" basePrice="70" revenue="15"> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" when="tileLayingStep" ! class="rails.game.special.SpecialTileLay"> ! <SpecialTileLay tile="445" name="Lumber Terminal" location="G2,M2,N5,O4,P5" ! connected="no" free="yes" extra="yes"/> </SpecialProperty> </SpecialProperties> </Company> ! <Company name="M&C" type="Private" basePrice="100" revenue="20"> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" when="anyTimeDuringORTurn" ! class="rails.game.specific._18AL.NameTrains" ! transfer="toCompany"> ! <NameTrains class="rails.game.specific._18AL.NamedTrainToken"> ! <NamedTrainToken name="RELee" longName=""Robert E. Lee" (Bir-Atl)" value="20" ifRouteIncludes="G4,G8"/> ! <NamedTrainToken name="PanAm" longName=""Pan American" (Nas-Mob)" value="40" ifRouteIncludes="A4,Q2"/> </NameTrains> </SpecialProperty> </SpecialProperties> </Company> ! <Company name="NDY" type="Private" basePrice="120" revenue="20"> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" when="duringTrainBuyingStep" class="rails.game.special.SpecialTrainBuy" closeIfExercised="yes"> ! <SpecialTrainBuy trainType="any" deduction="50%"/> </SpecialProperty> </SpecialProperties> <ClosingConditions> ! <SpecialProperties condition="ifExercised"/> </ClosingConditions> </Company> ! ! <Company name="WRA" type="Public" tokens="4" fgColour="000000" bgColour="FF8000"> ! <Home hex="L5"/> ! <Destination hex="J7"/> </Company> ! <Company name="TAG" type="Public" tokens="2" fgColour="FFFFFF" bgColour="800080"> ! <Home hex="E6"/> ! <Destination hex="G4"/> </Company> ! <Company name="M&O" type="Public" tokens="4" fgColour="000000" bgColour="00FF00"> ! <Home hex="Q2"/> ! <Destination hex="K2"/> </Company> ! <Company name="ATN" type="Public" tokens="3" fgColour="000000" bgColour="808080"> ! <Home hex="F1"/> ! <Destination hex="L1"/> </Company> ! <Company name="AB&C" type="Public" tokens="2" fgColour="000000" bgColour="FFFF00"> ! <Home hex="G6"/> ! <Destination hex="G4"/> </Company> ! <Company name="L&N" type="Public" tokens="4" fgColour="000000" bgColour="FF0000"> ! <Home hex="A4"/> ! <Destination hex="G4"/> </Company> <StartPacket roundClass="rails.game.StartRound_1830"> --- 16,105 ---- <CanUseSpecialProperties/> </CompanyType> ! <Company name="Tusc" type="Private" basePrice="20" revenue="5" longname="Tuscumbia Railway"/> ! <Company name="S&NA" type="Private" basePrice="40" revenue="10" ! longname="South & North Alabama Railroad"> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" ! when="anyTimeDuringORTurn" class="rails.game.special.SpecialTokenLay"> ! <SpecialTokenLay class="rails.game.BonusToken" ! location="E6,G4,G6,H3,H5" connected="yes" extra="yes"> ! <BonusToken name="Coalfield" value="10" ! removed="Phase:6" /> </SpecialTokenLay> </SpecialProperty> </SpecialProperties> </Company> ! <Company name="B&SLC" type="Private" basePrice="70" revenue="15" ! longname="Brown & Sons Lumber Co."> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" ! when="tileLayingStep" class="rails.game.special.SpecialTileLay"> ! <SpecialTileLay tile="445" name="Lumber Terminal" ! location="G2,M2,N5,O4,P5" connected="no" free="yes" extra="yes" /> </SpecialProperty> </SpecialProperties> </Company> ! <Company name="M&C" type="Private" basePrice="100" revenue="20" ! longname="Memphis & Charleston Railroad"> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" ! when="anyTimeDuringORTurn" ! class="rails.game.specific._18AL.NameTrains" transfer="toCompany"> ! <NameTrains ! class="rails.game.specific._18AL.NamedTrainToken"> ! <NamedTrainToken name="RELee" ! longName=""Robert E. Lee" (Bir-Atl)" value="20" ! ifRouteIncludes="G4,G8" /> ! <NamedTrainToken name="PanAm" ! longName=""Pan American" (Nas-Mob)" value="40" ! ifRouteIncludes="A4,Q2" /> </NameTrains> </SpecialProperty> </SpecialProperties> </Company> ! <Company name="NDY" type="Private" basePrice="120" revenue="20" ! longname="New Decatur Yards"> <SpecialProperties> ! <SpecialProperty condition="ifOwnedByCompany" ! when="duringTrainBuyingStep" class="rails.game.special.SpecialTrainBuy" closeIfExercised="yes"> ! <SpecialTrainBuy trainType="any" deduction="50%" /> </SpecialProperty> </SpecialProperties> <ClosingConditions> ! <SpecialProperties condition="ifExercised" /> </ClosingConditions> </Company> ! ! <Company name="WRA" type="Public" tokens="4" fgColour="000000" ! bgColour="FF8000" longname="Western Railway of Alabama"> ! <Home hex="L5" /> ! <Destination hex="J7" /> </Company> ! <Company name="TAG" type="Public" tokens="2" fgColour="FFFFFF" ! bgColour="800080" longname="Tennessee, Alabama & Georgia Railroad"> ! <Home hex="E6" /> ! <Destination hex="G4" /> </Company> ! <Company name="M&O" type="Public" tokens="4" fgColour="000000" ! bgColour="00FF00" longname="Mobile & Ohio Railroad"> ! <Home hex="Q2" /> ! <Destination hex="K2" /> </Company> ! <Company name="ATN" type="Public" tokens="3" fgColour="000000" ! bgColour="808080" longname="Alabama, Tennessee, & Northern Railroad"> ! <Home hex="F1" /> ! <Destination hex="L1" /> </Company> ! <Company name="AB&C" type="Public" tokens="2" fgColour="000000" ! bgColour="FFFF00" longname="Atlanta, Birmingham, & Coast Railroad"> ! <Home hex="G6" /> ! <Destination hex="G4" /> </Company> ! <Company name="L&N" type="Public" tokens="4" fgColour="000000" ! bgColour="FF0000" longname="Louisville & Nashville Railroad"> ! <Home hex="A4" /> ! <Destination hex="G4" /> </Company> <StartPacket roundClass="rails.game.StartRound_1830"> |
From: Stefan F. <ste...@us...> - 2010-02-22 22:48:29
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24165/rails/ui/swing Modified Files: ORUIManager.java Log Message: Minor fixes and improvements to NoMap OperatingCosts Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** ORUIManager.java 17 Feb 2010 22:02:56 -0000 1.55 --- ORUIManager.java 22 Feb 2010 22:48:20 -0000 1.56 *************** *** 764,773 **** for (OperatingCost ac:actionOC) { - int suggestedCost = ac.getAmount(); String suggestedCostText; ! if (suggestedCost == 0) suggestedCostText = LocalText.getText("OCAmountEntry"); else ! suggestedCostText = Bank.format(suggestedCost); OperatingCost.OCType t = ac.getOCType(); --- 764,772 ---- for (OperatingCost ac:actionOC) { String suggestedCostText; ! if (ac.isFreeEntryAllowed()) suggestedCostText = LocalText.getText("OCAmountEntry"); else ! suggestedCostText = Bank.format(ac.getAmount()); OperatingCost.OCType t = ac.getOCType(); *************** *** 790,794 **** int index = textOC.indexOf(chosenOption); OperatingCost chosenAction = actionOC.get(index); ! if (chosenAction.getAmount() == 0) { String costString = (String) JOptionPane.showInputDialog(orWindow, LocalText.getText("OCDialogMessage", chosenOption), --- 789,793 ---- int index = textOC.indexOf(chosenOption); OperatingCost chosenAction = actionOC.get(index); ! if (chosenAction.isFreeEntryAllowed()) { String costString = (String) JOptionPane.showInputDialog(orWindow, LocalText.getText("OCDialogMessage", chosenOption), *************** *** 1161,1165 **** protected void processCorrectionAction(CorrectionAction action) { ! gameUIManager.processOnServer((PossibleAction)action); } --- 1160,1164 ---- protected void processCorrectionAction(CorrectionAction action) { ! gameUIManager.processOnServer(action); } |
From: Stefan F. <ste...@us...> - 2010-02-22 22:48:28
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24165/rails/game Modified Files: OperatingRound.java Log Message: Minor fixes and improvements to NoMap OperatingCosts Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** OperatingRound.java 20 Feb 2010 23:08:42 -0000 1.104 --- OperatingRound.java 22 Feb 2010 22:48:18 -0000 1.105 *************** *** 2248,2253 **** // LayTile Actions for (Integer tc: mapManager.getPossibleTileCosts()) { ! possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_TILE, tc )); } --- 2248,2254 ---- // LayTile Actions for (Integer tc: mapManager.getPossibleTileCosts()) { ! if (tc <= operatingCompany.getCash()) ! possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_TILE, tc, false )); } *************** *** 2257,2263 **** int[] costs = operatingCompany.getBaseTokenLayCosts(); for (int cost : costs) { ! possibleActions.add(new OperatingCost( operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, ! cost )); } --- 2258,2265 ---- int[] costs = operatingCompany.getBaseTokenLayCosts(); for (int cost : costs) { ! if ((cost <= operatingCompany.getCash()) && (cost != 0 || costs.length == 1)) // distance method returns home base, but in sequence costs can be zero ! possibleActions.add(new OperatingCost( operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, ! cost, false )); } *************** *** 2266,2276 **** // Default OperatingCost Actions possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_TILE, 0 )); if (operatingCompany.getNumberOfFreeBaseTokens() != 0 && operatingCompany.getBaseTokenLayCost(null) != 0) { possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, 0 ! )); } --- 2268,2278 ---- // Default OperatingCost Actions possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_TILE, 0, true )); if (operatingCompany.getNumberOfFreeBaseTokens() != 0 && operatingCompany.getBaseTokenLayCost(null) != 0) { possibleActions.add(new OperatingCost( ! operatingCompany, OperatingCost.OCType.LAY_BASE_TOKEN, 0, true ! )); } |
From: Stefan F. <ste...@us...> - 2010-02-22 22:48:27
|
Update of /cvsroot/rails/18xx/rails/game/correct In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24165/rails/game/correct Modified Files: OperatingCost.java CorrectCash.java CorrectionAction.java ClosePrivate.java Log Message: Minor fixes and improvements to NoMap OperatingCosts Index: ClosePrivate.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/ClosePrivate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClosePrivate.java 17 Feb 2010 22:02:46 -0000 1.1 --- ClosePrivate.java 22 Feb 2010 22:48:18 -0000 1.2 *************** *** 12,16 **** */ ! public class ClosePrivate extends PossibleAction implements CorrectionAction { private static final long serialVersionUID = 1L; --- 12,16 ---- */ ! public class ClosePrivate extends CorrectionAction { private static final long serialVersionUID = 1L; *************** *** 18,24 **** /* Preconditions */ - /** shows in correction menu */ - private boolean inCorrectionMenu; - /** private company to close */ private PrivateCompanyI privateCompany; --- 18,21 ---- *************** *** 34,44 **** } - public boolean isInCorrectionMenu(){ - return inCorrectionMenu; - } - public void setCorrectionMenu(boolean menu){ - inCorrectionMenu = menu; - } - public PrivateCompanyI getPrivateCompany() { return privateCompany; --- 31,34 ---- Index: CorrectionAction.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/CorrectionAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CorrectionAction.java 17 Feb 2010 22:02:46 -0000 1.2 --- CorrectionAction.java 22 Feb 2010 22:48:18 -0000 1.3 *************** *** 1,8 **** package rails.game.correct; ! import rails.game.*; /** ! * Interface to implement for all non-correction action. ! * * * @author freystef --- 1,8 ---- package rails.game.correct; ! import rails.game.action.PossibleAction;; /** ! * Base class for all actions that correct the state of the game ! * that violate the ruleset. * * @author freystef *************** *** 10,16 **** */ ! public interface CorrectionAction { ! public boolean isInCorrectionMenu(); } --- 10,26 ---- */ ! public abstract class CorrectionAction extends PossibleAction { ! /** shows in correction menu */ ! protected boolean inCorrectionMenu; ! ! ! public boolean isInCorrectionMenu(){ ! return inCorrectionMenu; ! } ! ! public void setCorrectionMenu(boolean menu){ ! inCorrectionMenu = menu; ! } } Index: OperatingCost.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/OperatingCost.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OperatingCost.java 17 Feb 2010 22:02:45 -0000 1.3 --- OperatingCost.java 22 Feb 2010 22:48:18 -0000 1.4 *************** *** 11,18 **** * Correction action that mirrors operating actions like tile and token lays, but * only changes the cash position of a cashholder. - * (Extends PossibleAction instead of PossibleORAction to allow for generalization) * @author Stefan Frey */ ! public class OperatingCost extends PossibleAction implements CorrectCashI, CorrectionAction { public enum OCType {LAY_TILE, LAY_BASE_TOKEN}; --- 11,17 ---- * Correction action that mirrors operating actions like tile and token lays, but * only changes the cash position of a cashholder. * @author Stefan Frey */ ! public class OperatingCost extends CorrectionAction implements CorrectCashI { public enum OCType {LAY_TILE, LAY_BASE_TOKEN}; *************** *** 23,29 **** /* Preconditions */ - /** shows in correction menu */ - private boolean inCorrectionMenu; - /** operating Company */ transient private PublicCompanyI operatingCompany; --- 22,25 ---- *************** *** 41,44 **** --- 37,43 ---- private int maximumCost; + /** allow free entry */ + private boolean freeEntryAllowed; + /* Postconditions */ *************** *** 51,72 **** * @param pc Public Company */ ! public OperatingCost(PublicCompanyI pc, OCType ot, int ocCosts) { operatingCompany = pc; operatingCompanyName = pc.getName(); operatingCostType = ot; suggestedCost = ocCosts; maximumCost = pc.getCash(); } - - public boolean isInCorrectionMenu(){ - return inCorrectionMenu; - } - - public void setCorrectionMenu(boolean menu){ - inCorrectionMenu = menu; - } - - public CashHolder getCashHolder() { return operatingCompany; --- 50,62 ---- * @param pc Public Company */ ! public OperatingCost(PublicCompanyI pc, OCType ot, int ocCosts, boolean freeEntry) { operatingCompany = pc; operatingCompanyName = pc.getName(); operatingCostType = ot; suggestedCost = ocCosts; + freeEntryAllowed = freeEntry; maximumCost = pc.getCash(); } public CashHolder getCashHolder() { return operatingCompany; *************** *** 76,79 **** --- 66,73 ---- return operatingCompanyName; } + + public boolean isFreeEntryAllowed() { + return freeEntryAllowed; + } public int getAmount() { Index: CorrectCash.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/correct/CorrectCash.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CorrectCash.java 16 Feb 2010 20:17:14 -0000 1.2 --- CorrectCash.java 22 Feb 2010 22:48:18 -0000 1.3 *************** *** 14,18 **** * @author Stefan Frey */ ! public class CorrectCash extends PossibleAction implements CorrectCashI, CorrectionAction { /** The Constant serialVersionUID. */ --- 14,18 ---- * @author Stefan Frey */ ! public class CorrectCash extends CorrectionAction implements CorrectCashI { /** The Constant serialVersionUID. */ *************** *** 20,27 **** /* Preconditions */ ! ! /** shows in correction menu */ ! private boolean inCorrectionMenu; ! /** cash holder */ transient private CashHolder correctCashHolder; --- 20,24 ---- /* Preconditions */ ! /** cash holder */ transient private CashHolder correctCashHolder; *************** *** 63,73 **** - public boolean isInCorrectionMenu(){ - return inCorrectionMenu; - } - public void setCorrectionMenu(boolean menu){ - inCorrectionMenu = menu; - } - public CashHolder getCashHolder() { return correctCashHolder; --- 60,63 ---- |
From: Erik V. <ev...@us...> - 2010-02-20 23:08:50
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5192/rails/game Modified Files: OperatingRound.java Log Message: Use explicit allowance to use special properties. Fixed problem where special token lay was offered twice (1835 PfB) Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** OperatingRound.java 20 Feb 2010 12:34:46 -0000 1.103 --- OperatingRound.java 20 Feb 2010 23:08:42 -0000 1.104 *************** *** 600,605 **** --- 600,609 ---- log.debug("This was a normal token lay"); } + if (currentNormalTokenLays.isEmpty()) { log.debug("No more normal token lays are allowed"); + } else if (operatingCompany.getNumberOfFreeBaseTokens() == 0) { + log.debug("Normal token lay allowed by no more tokens"); + currentNormalTokenLays.clear(); } else { log.debug("A normal token lay is still allowed"); *************** *** 1203,1211 **** /* Special-property tile lays */ currentSpecialTileLays.clear(); ! /* ! * In 1835, this only applies to major companies. TODO: For now, ! * hardcode this, but it must become configurable later. ! */ ! if (operatingCompany.getType().getName().equals("Minor")) return; for (SpecialTileLay stl : getSpecialProperties(SpecialTileLay.class)) { --- 1207,1212 ---- /* Special-property tile lays */ currentSpecialTileLays.clear(); ! ! if (!operatingCompany.canUseSpecialProperties()) return; for (SpecialTileLay stl : getSpecialProperties(SpecialTileLay.class)) { *************** *** 1243,1246 **** --- 1244,1249 ---- currentSpecialTokenLays.clear(); + if (!operatingCompany.canUseSpecialProperties()) return; + /* * In 1835, this only applies to major companies. TODO: For now, *************** *** 2150,2196 **** } ! // Are there any "common" special properties, ! // i.e. properties that are available to everyone? ! List<SpecialPropertyI> commonSP = gameManager.getCommonSpecialProperties(); ! if (commonSP != null) { ! SellBonusToken sbt; ! loop: for (SpecialPropertyI sp : commonSP) { ! if (sp instanceof SellBonusToken) { ! sbt = (SellBonusToken) sp; ! // Can't buy if already owned ! if (operatingCompany.getBonuses() != null) { ! for (Bonus bonus : operatingCompany.getBonuses()) { ! if (bonus.getName().equals(sp.getName())) continue loop; } } - possibleActions.add (new BuyBonusToken (sbt)); } } ! } ! ! // Are there other step-independent special properties owned by the company? ! List<SpecialPropertyI> orsps = operatingCompany.getPortfolio().getAllSpecialProperties(); ! if (orsps != null) { ! for (SpecialPropertyI sp : orsps) { ! if (!sp.isExercised() && sp.isUsableIfOwnedByCompany() ! && sp.isUsableDuringOR()) { ! if (sp instanceof SpecialTokenLay) { ! possibleActions.add(new LayBaseToken((SpecialTokenLay)sp)); ! } else { ! possibleActions.add(new UseSpecialProperty(sp)); } } } ! } ! // Are there other step-independent special properties owned by teh president? ! orsps = getCurrentPlayer().getPortfolio().getAllSpecialProperties(); ! if (orsps != null) { ! for (SpecialPropertyI sp : orsps) { ! if (!sp.isExercised() && sp.isUsableIfOwnedByPlayer() ! && sp.isUsableDuringOR()) { ! if (sp instanceof SpecialTokenLay) { ! possibleActions.add(new LayBaseToken((SpecialTokenLay)sp)); ! } else { ! possibleActions.add(new UseSpecialProperty(sp)); } } --- 2153,2206 ---- } ! if (operatingCompany.canUseSpecialProperties()) { ! ! // Are there any "common" special properties, ! // i.e. properties that are available to everyone? ! List<SpecialPropertyI> commonSP = gameManager.getCommonSpecialProperties(); ! if (commonSP != null) { ! SellBonusToken sbt; ! loop: for (SpecialPropertyI sp : commonSP) { ! if (sp instanceof SellBonusToken) { ! sbt = (SellBonusToken) sp; ! // Can't buy if already owned ! if (operatingCompany.getBonuses() != null) { ! for (Bonus bonus : operatingCompany.getBonuses()) { ! if (bonus.getName().equals(sp.getName())) continue loop; ! } } + possibleActions.add (new BuyBonusToken (sbt)); } } } ! ! // Are there other step-independent special properties owned by the company? ! List<SpecialPropertyI> orsps = operatingCompany.getPortfolio().getAllSpecialProperties(); ! if (orsps != null) { ! for (SpecialPropertyI sp : orsps) { ! if (!sp.isExercised() && sp.isUsableIfOwnedByCompany() ! && sp.isUsableDuringOR()) { ! if (sp instanceof SpecialTokenLay) { ! if (getStep() != GameDef.OrStep.LAY_TOKEN) { ! possibleActions.add(new LayBaseToken((SpecialTokenLay)sp)); ! } ! } else { ! possibleActions.add(new UseSpecialProperty(sp)); ! } } } } ! // Are there other step-independent special properties owned by the president? ! orsps = getCurrentPlayer().getPortfolio().getAllSpecialProperties(); ! if (orsps != null) { ! for (SpecialPropertyI sp : orsps) { ! if (!sp.isExercised() && sp.isUsableIfOwnedByPlayer() ! && sp.isUsableDuringOR()) { ! if (sp instanceof SpecialTokenLay) { ! if (getStep() != GameDef.OrStep.LAY_TOKEN) { ! possibleActions.add(new LayBaseToken((SpecialTokenLay)sp)); ! } ! } else { ! possibleActions.add(new UseSpecialProperty(sp)); ! } } } |
From: Erik V. <ev...@us...> - 2010-02-20 23:07:10
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5037/data/1835 Modified Files: Game.xml Log Message: Using StockRound_1835 Index: Game.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/Game.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Game.xml 20 Feb 2010 12:34:34 -0000 1.26 --- Game.xml 20 Feb 2010 23:06:58 -0000 1.27 *************** *** 10,17 **** <PlayerShareLimit percentage="60"/> <BankPoolLimit percentage="50"/> ! <StockRound class="rails.game.StockRound" sequence="SellBuySell"> - <!--StockRound class="rails.game.specific._1835.StockRound_1835" - sequence="SellBuySell"--> <NoSaleInFirstSR/> <NoSaleIfNotOperated/> --- 10,15 ---- <PlayerShareLimit percentage="60"/> <BankPoolLimit percentage="50"/> ! <StockRound class="rails.game.specific._1835.StockRound_1835" sequence="SellBuySell"> <NoSaleInFirstSR/> <NoSaleIfNotOperated/> |
From: Erik V. <ev...@us...> - 2010-02-20 23:06:46
|
Update of /cvsroot/rails/18xx/data/18Kaas In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4976/data/18Kaas Modified Files: CompanyManager.xml Log Message: Added <CanUseSpecialProperties> Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/18Kaas/CompanyManager.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CompanyManager.xml 6 Feb 2010 23:45:55 -0000 1.11 --- CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.12 *************** *** 14,17 **** --- 14,18 ---- </BaseTokens> <Trains number="4,4,3,2"/> + <CanUseSpecialProperties/> </CompanyType> <Company name="SVNRR" type="Private" basePrice="20" revenue="5"> |
From: Erik V. <ev...@us...> - 2010-02-20 23:06:46
|
Update of /cvsroot/rails/18xx/data/1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4976/data/1856 Modified Files: CompanyManager.xml Log Message: Added <CanUseSpecialProperties> Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1856/CompanyManager.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** CompanyManager.xml 3 Feb 2010 20:16:40 -0000 1.34 --- CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.35 *************** *** 16,19 **** --- 16,20 ---- <Loans value="100" perRound="1" interest="10"/> <!-- Number of loans is undefined and handled in the code --> + <CanUseSpecialProperties/> </CompanyType> <CompanyType name="State" class="rails.game.specific._1856.PublicCompany_CGR"> |
From: Erik V. <ev...@us...> - 2010-02-20 23:06:46
|
Update of /cvsroot/rails/18xx/data/1830 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4976/data/1830 Modified Files: CompanyManager.xml Log Message: Added <CanUseSpecialProperties> Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1830/CompanyManager.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** CompanyManager.xml 6 Feb 2010 23:45:55 -0000 1.34 --- CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.35 *************** *** 17,20 **** --- 17,21 ---- <Certificate shares="1" number="8"/> <Trains number="4,4,3,2"/> + <CanUseSpecialProperties/> </CompanyType> <Company name="SVNRR" type="Private" basePrice="20" revenue="5" |
From: Erik V. <ev...@us...> - 2010-02-20 23:06:46
|
Update of /cvsroot/rails/18xx/data/1870 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4976/data/1870 Modified Files: CompanyManager.xml Log Message: Added <CanUseSpecialProperties> Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1870/CompanyManager.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** CompanyManager.xml 15 Feb 2010 22:38:36 -0000 1.24 --- CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.25 *************** *** 19,22 **** --- 19,23 ---- </BaseTokens> <Trains number="4,4,3,2"/> + <CanUseSpecialProperties/> </CompanyType> |
From: Erik V. <ev...@us...> - 2010-02-20 23:06:46
|
Update of /cvsroot/rails/18xx/data/1835 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4976/data/1835 Modified Files: CompanyManager.xml Log Message: Added <CanUseSpecialProperties> Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1835/CompanyManager.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CompanyManager.xml 20 Feb 2010 12:34:43 -0000 1.26 --- CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.27 *************** *** 26,29 **** --- 26,30 ---- <Capitalisation type="incremental"/> <Trains number="4,4,3,2"/> + <CanUseSpecialProperties/> </CompanyType> |
From: Erik V. <ev...@us...> - 2010-02-20 23:06:46
|
Update of /cvsroot/rails/18xx/data/1889 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4976/data/1889 Modified Files: CompanyManager.xml Log Message: Added <CanUseSpecialProperties> Index: CompanyManager.xml =================================================================== RCS file: /cvsroot/rails/18xx/data/1889/CompanyManager.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompanyManager.xml 6 Feb 2010 23:45:54 -0000 1.2 --- CompanyManager.xml 20 Feb 2010 23:06:38 -0000 1.3 *************** *** 20,23 **** --- 20,24 ---- <Certificate shares="1" number="8"/> <Trains number="4,4,3,2"/> + <CanUseSpecialProperties/> </CompanyType> <IfOption name="BeginnerGame" value="yes"> |