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...> - 2010-01-14 21:01:35
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7042/rails/game Modified Files: OperatingRound.java Log Message: Changes some unnecessary class attributes into local variables Index: OperatingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** OperatingRound.java 30 Dec 2009 11:32:00 -0000 1.87 --- OperatingRound.java 14 Jan 2010 21:01:19 -0000 1.88 *************** *** 4,7 **** --- 4,8 ---- import java.util.*; + import rails.common.GuiDef; import rails.game.action.*; import rails.game.move.CashMove; *************** *** 14,18 **** * Implements a basic Operating Round. <p> A new instance must be created for * each new Operating Round. At the end of a round, the current instance should ! * be discarded. <p> Permanent memory is formed by static attributes. */ public class OperatingRound extends Round implements Observer { --- 15,19 ---- * Implements a basic Operating Round. <p> A new instance must be created for * each new Operating Round. At the end of a round, the current instance should ! * be discarded. */ public class OperatingRound extends Round implements Observer { *************** *** 23,28 **** protected boolean actionPossible = true; - protected String actionNotPossibleMessage = ""; - protected TreeMap<Integer, PublicCompanyI> operatingCompanies; protected List<PublicCompanyI> companiesOperatedThisRound --- 24,27 ---- *************** *** 33,38 **** protected IntegerState operatingCompanyIndexObject; - protected int operatingCompanyIndex; - protected PublicCompanyI operatingCompany; --- 32,35 ---- *************** *** 61,66 **** protected Map<PublicCompanyI, Integer> loansThisRound = null; - protected PhaseI currentPhase; - protected String thisOrNumber; --- 58,61 ---- *************** *** 69,86 **** protected PossibleAction savedAction = null; ! protected int cashToBeRaisedByPresident = 0; ! ! protected int splitRule = SPLIT_NOT_ALLOWED; // To be made configurable ! ! /* Permanent memory */ ! static protected List<Player> players; ! ! static protected int numberOfPlayers = 0; ! ! /* Constants */ ! public static final int SPLIT_NOT_ALLOWED = 0; ! ! public static final int SPLIT_ROUND_UP = 1; // More money to the ! // shareholders public static final int SPLIT_ROUND_DOWN = 2; // More to the treasury --- 64,68 ---- protected PossibleAction savedAction = null; ! //protected int cashToBeRaisedByPresident = 0; public static final int SPLIT_ROUND_DOWN = 2; // More to the treasury *************** *** 124,133 **** super (gameManager); - if (players == null) { - players = gameManager.getPlayers(); - numberOfPlayers = players.size(); - } - operatingCompanyArray = super.getOperatingCompanies(); } --- 106,114 ---- super (gameManager); operatingCompanyArray = super.getOperatingCompanies(); + + guiHints.setVisibilityHint(GuiDef.Panel.STOCK_MARKET, false); + guiHints.setVisibilityHint(GuiDef.Panel.STATUS, true); + guiHints.setActivePanel(GuiDef.Panel.MAP); } *************** *** 323,327 **** if (tile == null) break; ! if (!currentPhase.isTileColourAllowed(tile.getColourName())) { errMsg = LocalText.getText("TileNotYetAvailable", --- 304,308 ---- if (tile == null) break; ! if (!getCurrentPhase().isTileColourAllowed(tile.getColourName())) { errMsg = LocalText.getText("TileNotYetAvailable", *************** *** 1033,1038 **** int step = stepObject.intValue(); - currentPhase = gameManager.getCurrentPhase(); - if (step == STEP_LAY_TRACK) { getNormalTileLays(); --- 1014,1017 ---- *************** *** 1063,1067 **** tileLaysPerColour = ! new HashMap<String, Integer>(currentPhase.getTileColours()); // Clone // it. int allowedNumber; --- 1042,1046 ---- tileLaysPerColour = ! new HashMap<String, Integer>(getCurrentPhase().getTileColours()); // Clone // it. int allowedNumber; *************** *** 1258,1262 **** } ! operatingCompanyIndex = operatingCompanyIndexObject.intValue(); if (operatingCompanyIndex >= operatingCompanyArray.length) { --- 1237,1241 ---- } ! int operatingCompanyIndex = operatingCompanyIndexObject.intValue(); if (operatingCompanyIndex >= operatingCompanyArray.length) { *************** *** 1265,1268 **** --- 1244,1248 ---- } else { operatingCompany = operatingCompanyArray[operatingCompanyIndex]; + log.debug("Operating company is "+operatingCompany.getName()+" in "+getRoundName()); return true; } *************** *** 1295,1298 **** --- 1275,1279 ---- int price = action.getPricePaid(); int actualPresidentCash = 0; + int cashToBeRaisedByPresident = 0; Player currentPlayer = operatingCompany.getPresident(); *************** *** 1455,1462 **** // Check if the phase has changed. gameManager.getTrainManager().checkTrainAvailability(train, oldHolder); - currentPhase = getCurrentPhase(); // Check if any companies must discard trains ! if (currentPhase != previousPhase && checkForExcessTrains()) { stepObject.set(STEP_DISCARD_TRAINS); } --- 1436,1442 ---- // Check if the phase has changed. gameManager.getTrainManager().checkTrainAvailability(train, oldHolder); // Check if any companies must discard trains ! if (getCurrentPhase() != previousPhase && checkForExcessTrains()) { stepObject.set(STEP_DISCARD_TRAINS); } *************** *** 1470,1474 **** Player player; for (PublicCompanyI comp : operatingCompanyArray) { ! if (comp.getPortfolio().getNumberOfTrains() > comp.getTrainLimit(currentPhase.getIndex())) { player = comp.getPresident(); if (!excessTrainCompanies.containsKey(player)) { --- 1450,1454 ---- Player player; for (PublicCompanyI comp : operatingCompanyArray) { ! if (comp.getPortfolio().getNumberOfTrains() > comp.getTrainLimit(getCurrentPhase().getIndex())) { player = comp.getPresident(); if (!excessTrainCompanies.containsKey(player)) { *************** *** 1604,1608 **** // Is private buying allowed? ! if (!currentPhase.isPrivateSellingAllowed()) { errMsg = LocalText.getText("PrivateBuyingIsNotAllowed"); break; --- 1584,1588 ---- // Is private buying allowed? ! if (!getCurrentPhase().isPrivateSellingAllowed()) { errMsg = LocalText.getText("PrivateBuyingIsNotAllowed"); break; *************** *** 1817,1821 **** if (remainder > presCash) { // Start a share selling round ! cashToBeRaisedByPresident = remainder - presCash; log.info("A share selling round must be started as the president cannot pay $" + remainder + " loan repayment"); --- 1797,1801 ---- if (remainder > presCash) { // Start a share selling round ! int cashToBeRaisedByPresident = remainder - presCash; log.info("A share selling round must be started as the president cannot pay $" + remainder + " loan repayment"); *************** *** 1936,1940 **** public boolean setPossibleActions() { ! operatingCompanyIndex = operatingCompanyIndexObject.intValue(); operatingCompany = operatingCompanyArray[operatingCompanyIndex]; --- 1916,1920 ---- public boolean setPossibleActions() { ! int operatingCompanyIndex = operatingCompanyIndexObject.intValue(); operatingCompany = operatingCompanyArray[operatingCompanyIndex]; *************** *** 1981,2003 **** // primary action is not forced. if (step >= 0) { ! setBonusTokenLays(); setDestinationActions(); ! setGameSpecificPossibleActions(); ! // Can private companies be bought? if (getCurrentPhase().isPrivateSellingAllowed()) { ! // Create a list of players with the current one in front int currentPlayerIndex = operatingCompany.getPresident().getIndex(); Player player; int minPrice, maxPrice; for (int i = currentPlayerIndex; i < currentPlayerIndex + numberOfPlayers; i++) { player = players.get(i % numberOfPlayers); for (PrivateCompanyI privComp : player.getPortfolio().getPrivateCompanies()) { ! minPrice = (int) (privComp.getBasePrice() * operatingCompany.getLowerPrivatePriceFactor()); --- 1961,1985 ---- // primary action is not forced. if (step >= 0) { ! setBonusTokenLays(); setDestinationActions(); ! setGameSpecificPossibleActions(); ! // Can private companies be bought? if (getCurrentPhase().isPrivateSellingAllowed()) { ! // Create a list of players with the current one in front int currentPlayerIndex = operatingCompany.getPresident().getIndex(); Player player; int minPrice, maxPrice; + List<Player> players = getPlayers(); + int numberOfPlayers = getNumberOfPlayers(); for (int i = currentPlayerIndex; i < currentPlayerIndex + numberOfPlayers; i++) { player = players.get(i % numberOfPlayers); for (PrivateCompanyI privComp : player.getPortfolio().getPrivateCompanies()) { ! minPrice = (int) (privComp.getBasePrice() * operatingCompany.getLowerPrivatePriceFactor()); *************** *** 2009,2013 **** } } ! // Are there any "common" special properties, // i.e. properties that are available to everyone? --- 1991,1995 ---- } } ! // Are there any "common" special properties, // i.e. properties that are available to everyone? *************** *** 2091,2103 **** // First check if any more trains may be bought from the Bank // Postpone train limit checking, because an exchange might be possible ! if (currentPhase.canBuyMoreTrainsPerTurn() || trainsBoughtThisTurn.isEmpty()) { boolean mayBuyMoreOfEachType = ! currentPhase.canBuyMoreTrainsPerTypePerTurn(); /* New trains */ trains = trainMgr.getAvailableNewTrains(); for (TrainI train : trains) { ! if (!operatingCompany.mayBuyTrainType(train)) continue; if (!mayBuyMoreOfEachType && trainsBoughtThisTurn.contains(train.getType())) { --- 2073,2085 ---- // First check if any more trains may be bought from the Bank // Postpone train limit checking, because an exchange might be possible ! if (getCurrentPhase().canBuyMoreTrainsPerTurn() || trainsBoughtThisTurn.isEmpty()) { boolean mayBuyMoreOfEachType = ! getCurrentPhase().canBuyMoreTrainsPerTypePerTurn(); /* New trains */ trains = trainMgr.getAvailableNewTrains(); for (TrainI train : trains) { ! if (!operatingCompany.mayBuyTrainType(train)) continue; if (!mayBuyMoreOfEachType && trainsBoughtThisTurn.contains(train.getType())) { *************** *** 2179,2183 **** /* Other company trains, sorted by president (current player first) */ ! if (currentPhase.isTrainTradingAllowed()) { PublicCompanyI c; BuyTrain bt; --- 2161,2165 ---- /* Other company trains, sorted by president (current player first) */ ! if (getCurrentPhase().isTrainTradingAllowed()) { PublicCompanyI c; BuyTrain bt; *************** *** 2185,2188 **** --- 2167,2172 ---- Portfolio pf; int index; + int numberOfPlayers = getNumberOfPlayers(); + // Set up a list per player of presided companies List<List<PublicCompanyI>> companiesPerPlayer = *************** *** 2255,2259 **** int currentPlayerIndex = getCurrentPlayerIndex(); for (int i = currentPlayerIndex; i < currentPlayerIndex ! + numberOfPlayers; i++) { player = gameManager.getPlayerByIndex(i); if (excessTrainCompanies.containsKey(player)) { --- 2239,2243 ---- int currentPlayerIndex = getCurrentPlayerIndex(); for (int i = currentPlayerIndex; i < currentPlayerIndex ! + getNumberOfPlayers(); i++) { player = gameManager.getPlayerByIndex(i); if (excessTrainCompanies.containsKey(player)) { *************** *** 2272,2279 **** } - public int getCashToBeRaisedByPresident() { - return cashToBeRaisedByPresident; - } - /** * This is currently a stub, as it is unclear if there is a common --- 2256,2259 ---- |
From: Erik V. <ev...@us...> - 2010-01-14 21:00:40
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6845/rails/game Modified Files: Round.java Log Message: Added some generic getters. Cleanups Index: Round.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Round.java 30 Dec 2009 11:32:31 -0000 1.33 --- Round.java 14 Jan 2010 21:00:30 -0000 1.34 *************** *** 10,13 **** --- 10,14 ---- import org.apache.log4j.Logger; + import rails.common.GuiHints; import rails.game.action.*; import rails.game.move.CashMove; *************** *** 23,26 **** --- 24,28 ---- protected PossibleActions possibleActions = PossibleActions.getInstance(); + protected GuiHints guiHints = null; protected static Logger log = *************** *** 38,42 **** protected MapManager mapManager = null; ! protected Class<? extends RoundI> roundTypeForUI = null; protected BooleanState wasInterrupted = new BooleanState ("RoundInterrupted", false); --- 40,44 ---- protected MapManager mapManager = null; ! //protected Class<? extends RoundI> roundTypeForUI = null; protected BooleanState wasInterrupted = new BooleanState ("RoundInterrupted", false); *************** *** 53,73 **** this.gameManager = aGameManager; ! if (aGameManager == null) { companyManager = null; } else { ! companyManager = aGameManager.getCompanyManager(); ! playerManager = aGameManager.getPlayerManager(); ! bank = aGameManager.getBank(); ipo = bank.getIpo(); pool = bank.getPool(); unavailable = bank.getUnavailable(); scrapHeap = bank.getScrapHeap(); ! stockMarket = aGameManager.getStockMarket(); ! mapManager = aGameManager.getMapManager(); ! moveStack = aGameManager.getMoveStack(); } ! roundTypeForUI = getClass(); } --- 55,77 ---- this.gameManager = aGameManager; ! if (gameManager == null) { companyManager = null; } else { ! companyManager = gameManager.getCompanyManager(); ! playerManager = gameManager.getPlayerManager(); ! bank = gameManager.getBank(); ipo = bank.getIpo(); pool = bank.getPool(); unavailable = bank.getUnavailable(); scrapHeap = bank.getScrapHeap(); ! stockMarket = gameManager.getStockMarket(); ! mapManager = gameManager.getMapManager(); ! moveStack = gameManager.getMoveStack(); } ! //roundTypeForUI = getClass(); ! guiHints = gameManager.getUIHints(); ! guiHints.setCurrentRoundType(getClass()); } *************** *** 98,101 **** --- 102,113 ---- } + protected List<Player> getPlayers() { + return gameManager.getPlayers(); + } + + protected int getNumberOfPlayers() { + return gameManager.getNumberOfPlayers(); + } + public PhaseI getCurrentPhase() { return gameManager.getCurrentPhase(); *************** *** 112,118 **** } ! public void setRoundTypeForUI(Class<? extends RoundI> roundTypeForUI) { ! this.roundTypeForUI = roundTypeForUI; ! } public String getGameOption (String name) { --- 124,130 ---- } ! //public void setRoundTypeForUI(Class<? extends RoundI> roundTypeForUI) { ! // this.roundTypeForUI = roundTypeForUI; ! //} public String getGameOption (String name) { *************** *** 345,354 **** for (PublicCompanyI c : companyManager.getAllPublicCompanies()) { if (c.hasFloated() && !c.isClosed()) { ! ReportBuffer.add(LocalText.getText("Has", c.getName(), Bank.format(c.getCash()))); } } for (Player p : playerManager.getPlayers()) { ! ReportBuffer.add(LocalText.getText("Has", p.getName(), Bank.format(p.getCash()))); } --- 357,366 ---- for (PublicCompanyI c : companyManager.getAllPublicCompanies()) { if (c.hasFloated() && !c.isClosed()) { ! ReportBuffer.add(LocalText.getText("Has", c.getName(), Bank.format(c.getCash()))); } } for (Player p : playerManager.getPlayers()) { ! ReportBuffer.add(LocalText.getText("Has", p.getName(), Bank.format(p.getCash()))); } |
From: Erik V. <ev...@us...> - 2010-01-14 20:59:27
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6493/rails/game Modified Files: ShareSellingRound.java Log Message: Added GUIHints Index: ShareSellingRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/ShareSellingRound.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ShareSellingRound.java 26 Nov 2009 20:14:00 -0000 1.26 --- ShareSellingRound.java 14 Jan 2010 20:59:19 -0000 1.27 *************** *** 8,11 **** --- 8,12 ---- import java.util.*; + import rails.common.GuiDef; import rails.game.action.PossibleAction; import rails.game.action.SellShares; *************** *** 38,41 **** --- 39,44 ---- super (gameManager); this.parentRound = parentRound; + + guiHints.setActivePanel(GuiDef.Panel.STATUS); } |
From: Erik V. <ev...@us...> - 2010-01-14 20:59:20
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6431/rails/game Modified Files: StartRound.java Log Message: Added GUIHints Index: StartRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** StartRound.java 8 Jan 2010 21:30:46 -0000 1.33 --- StartRound.java 14 Jan 2010 20:59:03 -0000 1.34 *************** *** 4,7 **** --- 4,8 ---- import java.util.List; + import rails.common.GuiDef; import rails.game.action.*; import rails.game.model.ModelObject; *************** *** 47,50 **** --- 48,56 ---- super (gameManager); this.startPacket = gameManager.getStartPacket(); + + guiHints.setVisibilityHint(GuiDef.Panel.STATUS, false); + guiHints.setVisibilityHint(GuiDef.Panel.STOCK_MARKET, false); + guiHints.setVisibilityHint(GuiDef.Panel.MAP, true); + guiHints.setActivePanel(GuiDef.Panel.START_ROUND); } *************** *** 300,304 **** protected abstract boolean pass(String playerName); ! /*----- Setting up the UI for the next action -----*/ /** --- 306,315 ---- protected abstract boolean pass(String playerName); ! @Override ! protected void finishRound() { ! super.finishRound(); ! } ! ! /*----- Setting up the UI for the next action -----*/ /** |
From: Erik V. <ev...@us...> - 2010-01-14 20:58:51
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6270/rails/game Modified Files: StockRound.java Log Message: Added GUIHints Changed some attributes into game parameters Index: StockRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StockRound.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** StockRound.java 7 Dec 2009 17:50:16 -0000 1.53 --- StockRound.java 14 Jan 2010 20:58:39 -0000 1.54 *************** *** 3,6 **** --- 3,7 ---- import java.util.*; + import rails.common.GuiDef; import rails.game.action.*; import rails.game.move.CashMove; *************** *** 47,51 **** static protected final int SELL_BUY_OR_BUY_SELL = 2; ! /* Action comnstants */ static public final int BOUGHT = 0; static public final int SOLD = 1; --- 48,52 ---- static protected final int SELL_BUY_OR_BUY_SELL = 2; ! /* Action constants */ static public final int BOUGHT = 0; static public final int SOLD = 1; *************** *** 53,59 **** /* Rules */ protected int sequenceRule; - static protected boolean buySellInSameRound = true; - static protected boolean noSaleInFirstSR = false; - static protected boolean noSaleIfNotOperated = false; /** --- 54,57 ---- *************** *** 71,74 **** --- 69,75 ---- sequenceRule = gameManager.getStockRoundSequenceRule(); + guiHints.setVisibilityHint(GuiDef.Panel.MAP, true); + guiHints.setVisibilityHint(GuiDef.Panel.STOCK_MARKET, true); + guiHints.setActivePanel(GuiDef.Panel.STATUS); } *************** *** 843,847 **** // Check everything ! if (getStockRoundNumber() == 1 && noSaleInFirstSR) { errMsg = LocalText.getText("FirstSRNoSell"); break; --- 844,848 ---- // Check everything ! if (getStockRoundNumber() == 1 && noSaleInFirstSR()) { errMsg = LocalText.getText("FirstSRNoSell"); break; *************** *** 1222,1226 **** public boolean mayCurrentPlayerSellAnything() { ! if (getStockRoundNumber() == 1 && noSaleInFirstSR) return false; if (companyBoughtThisTurnWrapper.getObject() != null --- 1223,1227 ---- public boolean mayCurrentPlayerSellAnything() { ! if (getStockRoundNumber() == 1 && noSaleInFirstSR()) return false; if (companyBoughtThisTurnWrapper.getObject() != null *************** *** 1317,1326 **** ! public static void setNoSaleInFirstSR() { ! noSaleInFirstSR = true; } ! public static void setNoSaleIfNotOperated() { ! noSaleIfNotOperated = true; } --- 1318,1335 ---- ! //public static void setNoSaleInFirstSR() { ! // noSaleInFirstSR = true; ! //} ! ! //public static void setNoSaleIfNotOperated() { ! // noSaleIfNotOperated = true; ! //} ! ! protected boolean noSaleInFirstSR() { ! return (Boolean) gameManager.getGameParameter(GameDef.Parm.NO_SALE_IN_FIRST_SR); } ! protected boolean noSaleIfNotOperated() { ! return (Boolean) gameManager.getGameParameter(GameDef.Parm.NO_SALE_IF_NOT_OPERATED); } |
From: Erik V. <ev...@us...> - 2010-01-14 20:58:02
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6075/rails/game Modified Files: SwitchableUIRound.java Log Message: Empties (may get redundant) Index: SwitchableUIRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/SwitchableUIRound.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SwitchableUIRound.java 4 May 2009 20:29:14 -0000 1.1 --- SwitchableUIRound.java 14 Jan 2010 20:57:51 -0000 1.2 *************** *** 6,15 **** * @author Erik Vos * ! */ public abstract class SwitchableUIRound extends Round { ! public SwitchableUIRound (GameManagerI gameManager) { super (gameManager); - setRoundTypeForUI(null); } --- 6,14 ---- * @author Erik Vos * ! */ public abstract class SwitchableUIRound extends Round { ! public SwitchableUIRound (GameManagerI gameManager) { super (gameManager); } |
From: Erik V. <ev...@us...> - 2010-01-14 20:57:34
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5981/rails/game Modified Files: TreasuryShareRound.java Log Message: Added GUIHInts Index: TreasuryShareRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/TreasuryShareRound.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TreasuryShareRound.java 27 Nov 2009 20:30:56 -0000 1.15 --- TreasuryShareRound.java 14 Jan 2010 20:57:23 -0000 1.16 *************** *** 8,11 **** --- 8,12 ---- import java.util.*; + import rails.common.GuiDef; import rails.game.action.*; import rails.game.state.BooleanState; *************** *** 46,49 **** --- 47,52 ---- setCurrentPlayerIndex(sellingPlayer.getIndex()); + guiHints.setActivePanel(GuiDef.Panel.STATUS); + } |
From: Erik V. <ev...@us...> - 2010-01-14 20:57:17
|
Update of /cvsroot/rails/18xx/rails/game/action In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5928/rails/game/action Modified Files: PossibleActions.java Log Message: Changed comment Index: PossibleActions.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/PossibleActions.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PossibleActions.java 1 Jan 2010 18:57:56 -0000 1.15 --- PossibleActions.java 14 Jan 2010 20:57:08 -0000 1.16 *************** *** 14,19 **** * This class manages the actions that the current user can execute at any point * in time. Each possible action is represented by an instance of a subclass of ! * PossibleAction. The complete set is stored in a Map per action (subclass) ! * type. <p>This class is implemented as a singleton to prevent multiple * instances lingering around, as there can only be one set of possible actions * at any point in time. --- 14,19 ---- * This class manages the actions that the current user can execute at any point * in time. Each possible action is represented by an instance of a subclass of ! * PossibleAction. The complete set is stored in aan ArrayList. ! * <p>This class is implemented as a singleton to prevent multiple * instances lingering around, as there can only be one set of possible actions * at any point in time. *************** *** 88,96 **** // Save is always allowed ! if (checkedAction instanceof GameAction && ((GameAction)checkedAction).getMode() == GameAction.SAVE) { return true; } ! // Check if action accurs in the list of possible actions for (PossibleAction action : possibleActions) { --- 88,96 ---- // Save is always allowed ! if (checkedAction instanceof GameAction && ((GameAction)checkedAction).getMode() == GameAction.SAVE) { return true; } ! // Check if action accurs in the list of possible actions for (PossibleAction action : possibleActions) { |
From: Erik V. <ev...@us...> - 2010-01-14 20:56:53
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5785/rails/game/specific/_1856 Modified Files: CGRFormationRound.java Log Message: Added GUIHInts Index: CGRFormationRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** CGRFormationRound.java 5 Jan 2010 20:53:16 -0000 1.30 --- CGRFormationRound.java 14 Jan 2010 20:56:45 -0000 1.31 *************** *** 3,6 **** --- 3,7 ---- import java.util.*; + import rails.common.GuiDef; import rails.game.*; import rails.game.action.*; *************** *** 43,46 **** --- 44,50 ---- public CGRFormationRound (GameManagerI gameManager) { super (gameManager); + + guiHints.setVisibilityHint(GuiDef.Panel.MAP, true); + guiHints.setVisibilityHint(GuiDef.Panel.STATUS, true); } *************** *** 65,68 **** --- 69,74 ---- startingPlayer.getName())); + guiHints.setCurrentRoundType(getClass()); + // Collect companies having loans for (PublicCompanyI company : getOperatingCompanies()) { *************** *** 210,214 **** currentCompany.getValuePerLoan()); possibleActions.add(action); ! roundTypeForUI = StockRound_1856.class; } else if (step == STEP_EXCHANGE_TOKENS) { int numberToExchange = cgr.getNumberOfFreeBaseTokens(); --- 216,220 ---- currentCompany.getValuePerLoan()); possibleActions.add(action); ! guiHints.setActivePanel(GuiDef.Panel.STATUS); } else if (step == STEP_EXCHANGE_TOKENS) { int numberToExchange = cgr.getNumberOfFreeBaseTokens(); *************** *** 217,226 **** action.setCompany(cgr); possibleActions.add(action); ! roundTypeForUI = OperatingRound_1856.class; } else if (step == STEP_DISCARD_TRAINS) { DiscardTrain action = new DiscardTrain (cgr, trainsToDiscardFrom, forcedTrainDiscard); possibleActions.add(action); ! roundTypeForUI = OperatingRound_1856.class; } return true; --- 223,232 ---- action.setCompany(cgr); possibleActions.add(action); ! guiHints.setActivePanel(GuiDef.Panel.STATUS); } else if (step == STEP_DISCARD_TRAINS) { DiscardTrain action = new DiscardTrain (cgr, trainsToDiscardFrom, forcedTrainDiscard); possibleActions.add(action); ! guiHints.setActivePanel(GuiDef.Panel.STATUS); } return true; |
From: Erik V. <ev...@us...> - 2010-01-14 20:56:37
|
Update of /cvsroot/rails/18xx/rails/game/specific/_1856 In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5728/rails/game/specific/_1856 Modified Files: OperatingRound_1856.java Log Message: Changes some unnecessary class attributes into local variables Index: OperatingRound_1856.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** OperatingRound_1856.java 27 Dec 2009 18:30:11 -0000 1.27 --- OperatingRound_1856.java 14 Jan 2010 20:56:29 -0000 1.28 *************** *** 3,13 **** import java.util.*; import rails.game.*; import rails.game.action.*; import rails.game.move.CashMove; - import rails.game.state.BooleanState; - import rails.game.state.IntegerState; import rails.game.special.SellBonusToken; import rails.game.special.SpecialPropertyI; import rails.util.LocalText; --- 3,14 ---- import java.util.*; + import rails.common.GuiDef; import rails.game.*; import rails.game.action.*; import rails.game.move.CashMove; import rails.game.special.SellBonusToken; import rails.game.special.SpecialPropertyI; + import rails.game.state.BooleanState; + import rails.game.state.IntegerState; import rails.util.LocalText; *************** *** 16,19 **** --- 17,21 ---- private BooleanState finalLoanRepaymentPending = new BooleanState ("LoanRepaymentPending", false); + private Player playerToStartLoanRepayment = null; *************** *** 58,62 **** } ! operatingCompanyIndex = operatingCompanyIndexObject.intValue(); if (operatingCompanyIndex >= operatingCompanyArray.length) { --- 60,64 ---- } ! int operatingCompanyIndex = operatingCompanyIndexObject.intValue(); if (operatingCompanyIndex >= operatingCompanyArray.length) { *************** *** 190,194 **** if (remainder > presCash) { // Start a share selling round ! cashToBeRaisedByPresident = remainder - presCash; log.info("A share selling round must be started as the president cannot pay $" + remainder + " loan interest"); --- 192,196 ---- if (remainder > presCash) { // Start a share selling round ! int cashToBeRaisedByPresident = remainder - presCash; log.info("A share selling round must be started as the president cannot pay $" + remainder + " loan interest"); *************** *** 306,310 **** protected void setGameSpecificPossibleActions() { // Take a loan ! if (currentPhase.isLoanTakingAllowed() && operatingCompany.canLoan() && (loansThisRound == null --- 308,312 ---- protected void setGameSpecificPossibleActions() { // Take a loan ! if (getCurrentPhase().isLoanTakingAllowed() && operatingCompany.canLoan() && (loansThisRound == null *************** *** 356,364 **** public boolean buyTrain(BuyTrain action) { ! PhaseI prePhase = currentPhase; boolean result = super.buyTrain(action); ! PhaseI postPhase = currentPhase; if (postPhase != prePhase) { --- 358,366 ---- public boolean buyTrain(BuyTrain action) { ! PhaseI prePhase = getCurrentPhase(); boolean result = super.buyTrain(action); ! PhaseI postPhase = getCurrentPhase(); if (postPhase != prePhase) { *************** *** 463,466 **** --- 465,470 ---- // End of CGRFormationRound finalLoanRepaymentPending.set(false); + guiHints.setActivePanel(GuiDef.Panel.MAP); + if (!resetOperatingCompanies(mergingCompanies)) return; if (operatingCompany != null) { *************** *** 510,513 **** --- 514,518 ---- String message; + int operatingCompanyIndex = operatingCompanyIndexObject.intValue(); if (cgr.hasStarted()) { if (cgrCanOperate) { |
From: Erik V. <ev...@us...> - 2010-01-14 20:55:48
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5468/rails/game/specific/_18EU Modified Files: FinalMinorExchangeRound.java Log Message: Added GUIHInts Index: FinalMinorExchangeRound.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/FinalMinorExchangeRound.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FinalMinorExchangeRound.java 29 Oct 2009 19:41:30 -0000 1.9 --- FinalMinorExchangeRound.java 14 Jan 2010 20:55:37 -0000 1.10 *************** *** 4,7 **** --- 4,8 ---- import java.util.List; + import rails.common.GuiDef; import rails.game.*; import rails.game.action.MergeCompanies; *************** *** 19,22 **** --- 20,26 ---- public FinalMinorExchangeRound(GameManagerI aGameManager) { super (aGameManager); + + guiHints.setVisibilityHint(GuiDef.Panel.MAP, true); + guiHints.setActivePanel(GuiDef.Panel.STATUS); } |
From: Erik V. <ev...@us...> - 2010-01-14 20:55:22
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5344/rails/game/specific/_18EU Modified Files: OperatingRound_18EU.java Log Message: Abstracted some variables into methods, taking info from GameUIManager Index: OperatingRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/OperatingRound_18EU.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** OperatingRound_18EU.java 17 Nov 2009 19:31:27 -0000 1.9 --- OperatingRound_18EU.java 14 Jan 2010 20:55:13 -0000 1.10 *************** *** 121,125 **** /* Other company trains, sorted by president (current player first) */ ! if (currentPhase.isTrainTradingAllowed()) { PublicCompanyI c; BuyTrain bt; --- 121,125 ---- /* Other company trains, sorted by president (current player first) */ ! if (getCurrentPhase().isTrainTradingAllowed()) { PublicCompanyI c; BuyTrain bt; *************** *** 127,130 **** --- 127,132 ---- Portfolio pf; int index; + int numberOfPlayers = getNumberOfPlayers(); + // Set up a list per player of presided companies List<List<PublicCompanyI>> companiesPerPlayer = *************** *** 206,217 **** // A Pullmann always goes first, and automatically. // If the last train is a Pullmann, discard it. ! if ((numberOfTrains > comp.getTrainLimit(currentPhase.getIndex()) || numberOfTrains == 1) && pullmann != null) { pullmann.moveTo(pool); } // If we are still above the limit, make the list // of trains to select the discarded one from ! if (numberOfTrains > comp.getTrainLimit(currentPhase.getIndex())) { player = comp.getPresident(); if (!excessTrainCompanies.containsKey(player)) { --- 208,220 ---- // A Pullmann always goes first, and automatically. // If the last train is a Pullmann, discard it. ! if ((numberOfTrains > comp.getTrainLimit(getCurrentPhase().getIndex()) || numberOfTrains == 1) && pullmann != null) { pullmann.moveTo(pool); + numberOfTrains--; } // If we are still above the limit, make the list // of trains to select the discarded one from ! if (numberOfTrains > comp.getTrainLimit(getCurrentPhase().getIndex())) { player = comp.getPresident(); if (!excessTrainCompanies.containsKey(player)) { |
From: Erik V. <ev...@us...> - 2010-01-14 20:54:31
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5119/rails/game/specific/_18EU Modified Files: StockRound_18EU.java Log Message: Fixed SelectedHomeBase message Index: StockRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StockRound_18EU.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** StockRound_18EU.java 22 Dec 2009 11:18:13 -0000 1.30 --- StockRound_18EU.java 14 Jan 2010 20:54:23 -0000 1.31 *************** *** 429,433 **** ReportBuffer.add(LocalText.getText("SelectedHomeBase", company.getName(), - homeHex.getName(), selectedHomeCity.toString() )); } --- 429,432 ---- |
From: Erik V. <ev...@us...> - 2010-01-14 20:51:09
|
Update of /cvsroot/rails/18xx In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4535 Modified Files: LocalisedText.properties Log Message: Added missing SelectedHomeBase Index: LocalisedText.properties =================================================================== RCS file: /cvsroot/rails/18xx/LocalisedText.properties,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** LocalisedText.properties 8 Jan 2010 21:26:39 -0000 1.90 --- LocalisedText.properties 14 Jan 2010 20:51:01 -0000 1.91 *************** *** 368,371 **** --- 368,372 ---- SelectAToken=Select a token, select another hex, or press the No Token button. SelectHomeStation=Select a Home station for {0} + SelectedHomeBase={0} sets its home base at {1} SelectPayout=Select how the earnings are spent SellsItemFor={0} sells {1} for {2} |
From: Erik V. <ev...@us...> - 2010-01-14 20:50:44
|
Update of /cvsroot/rails/18xx/rails/util In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4455/rails/util Modified Files: RunGame.java Log Message: Defs->GuiDef name change Index: RunGame.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/util/RunGame.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RunGame.java 6 Nov 2009 20:21:12 -0000 1.1 --- RunGame.java 14 Jan 2010 20:50:34 -0000 1.2 *************** *** 1,5 **** package rails.util; ! import rails.common.Defs; import rails.game.Game; import rails.game.GameManagerI; --- 1,5 ---- package rails.util; ! import rails.common.GuiDef; import rails.game.Game; import rails.game.GameManagerI; *************** *** 63,67 **** GameManagerI gameManager = game.getGameManager(); GameUIManager gameUIManager; ! String gameUIManagerClassName = gameManager.getClassName(Defs.ClassName.GAME_UI_MANAGER); try { Class<? extends GameUIManager> gameUIManagerClass = --- 63,67 ---- GameManagerI gameManager = game.getGameManager(); GameUIManager gameUIManager; ! String gameUIManagerClassName = gameManager.getClassName(GuiDef.ClassName.GAME_UI_MANAGER); try { Class<? extends GameUIManager> gameUIManagerClass = |
From: Erik V. <ev...@us...> - 2010-01-14 20:50:17
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4361/rails/ui/swing Modified Files: StatusWindow.java ORWindow.java GameStatus.java GameSetupWindow.java ORPanel.java Log Message: Defs->GuiDef name change Index: StatusWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/StatusWindow.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** StatusWindow.java 11 Jan 2010 23:06:08 -0000 1.33 --- StatusWindow.java 14 Jan 2010 20:50:08 -0000 1.34 *************** *** 12,16 **** import org.apache.log4j.Logger; ! import rails.common.Defs; import rails.game.*; import rails.game.action.*; --- 12,16 ---- import org.apache.log4j.Logger; ! import rails.common.GuiDef; import rails.game.*; import rails.game.action.*; *************** *** 215,219 **** this.gameUIManager = gameUIManager; ! String gameStatusClassName = gameUIManager.getClassName(Defs.ClassName.GAME_STATUS); try { Class<? extends GameStatus> gameStatusClass = --- 215,219 ---- this.gameUIManager = gameUIManager; ! String gameStatusClassName = gameUIManager.getClassName(GuiDef.ClassName.GAME_STATUS); try { Class<? extends GameStatus> gameStatusClass = Index: GameSetupWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameSetupWindow.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** GameSetupWindow.java 30 Dec 2009 18:38:28 -0000 1.19 --- GameSetupWindow.java 14 Jan 2010 20:50:08 -0000 1.20 *************** *** 12,16 **** import org.apache.log4j.Logger; ! import rails.common.Defs; import rails.game.*; import rails.util.Config; --- 12,16 ---- import org.apache.log4j.Logger; ! import rails.common.GuiDef; import rails.game.*; import rails.util.Config; *************** *** 391,395 **** private void startGameUIManager(Game game) { GameManagerI gameManager = game.getGameManager(); ! String gameUIManagerClassName = gameManager.getClassName(Defs.ClassName.GAME_UI_MANAGER); try { Class<? extends GameUIManager> gameUIManagerClass = --- 391,395 ---- private void startGameUIManager(Game game) { GameManagerI gameManager = game.getGameManager(); ! String gameUIManagerClassName = gameManager.getClassName(GuiDef.ClassName.GAME_UI_MANAGER); try { Class<? extends GameUIManager> gameUIManagerClass = Index: GameStatus.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameStatus.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** GameStatus.java 11 Jan 2010 23:06:15 -0000 1.36 --- GameStatus.java 14 Jan 2010 20:50:08 -0000 1.37 *************** *** 11,15 **** import org.apache.log4j.Logger; ! import rails.common.Defs; import rails.game.*; import rails.game.action.*; --- 11,15 ---- import org.apache.log4j.Logger; ! import rails.common.GuiDef; import rails.game.*; import rails.game.action.*; *************** *** 138,145 **** nc = companies.length; ! hasParPrices = gameUIManager.getGameParameterAsBoolean(Defs.Parm.HAS_ANY_PAR_PRICE); ! compCanBuyPrivates = gameUIManager.getGameParameterAsBoolean(Defs.Parm.CAN_ANY_COMPANY_BUY_PRIVATES); ! compCanHoldOwnShares = gameUIManager.getGameParameterAsBoolean(Defs.Parm.CAN_ANY_COMPANY_HOLD_OWN_SHARES); ! hasCompanyLoans = gameUIManager.getGameParameterAsBoolean(Defs.Parm.HAS_ANY_COMPANY_LOANS); ipo = bank.getIpo(); --- 138,145 ---- nc = companies.length; ! hasParPrices = gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.HAS_ANY_PAR_PRICE); ! compCanBuyPrivates = gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.CAN_ANY_COMPANY_BUY_PRIVATES); ! compCanHoldOwnShares = gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.CAN_ANY_COMPANY_HOLD_OWN_SHARES); ! hasCompanyLoans = gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.HAS_ANY_COMPANY_LOANS); ipo = bank.getIpo(); Index: ORWindow.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORWindow.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ORWindow.java 31 Dec 2009 09:58:18 -0000 1.31 --- ORWindow.java 14 Jan 2010 20:50:08 -0000 1.32 *************** *** 14,18 **** import org.apache.log4j.Logger; ! import rails.common.Defs; import rails.game.*; import rails.game.action.*; --- 14,18 ---- import org.apache.log4j.Logger; ! import rails.common.GuiDef; import rails.game.*; import rails.game.action.*; *************** *** 46,50 **** this.gameUIManager = gameUIManager; ! String orUIManagerClassName = gameUIManager.getClassName(Defs.ClassName.OR_UI_MANAGER); try { Class<? extends ORUIManager> orUIManagerClass = --- 46,50 ---- this.gameUIManager = gameUIManager; ! String orUIManagerClassName = gameUIManager.getClassName(GuiDef.ClassName.OR_UI_MANAGER); try { Class<? extends ORUIManager> orUIManagerClass = Index: ORPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORPanel.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ORPanel.java 5 Jan 2010 20:54:05 -0000 1.38 --- ORPanel.java 14 Jan 2010 20:50:08 -0000 1.39 *************** *** 10,14 **** import org.apache.log4j.Logger; ! import rails.common.Defs; import rails.game.*; import rails.game.action.*; --- 10,14 ---- import org.apache.log4j.Logger; ! import rails.common.GuiDef; import rails.game.*; import rails.game.action.*; *************** *** 122,128 **** round = gameUIManager.getCurrentRound(); ! privatesCanBeBought = gameUIManager.getGameParameterAsBoolean(Defs.Parm.CAN_ANY_COMPANY_BUY_PRIVATES); ! bonusTokensExist = gameUIManager.getGameParameterAsBoolean(Defs.Parm.DO_BONUS_TOKENS_EXIST); ! hasCompanyLoans = gameUIManager.getGameParameterAsBoolean(Defs.Parm.HAS_ANY_COMPANY_LOANS); initButtonPanel(); --- 122,128 ---- round = gameUIManager.getCurrentRound(); ! privatesCanBeBought = gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.CAN_ANY_COMPANY_BUY_PRIVATES); ! bonusTokensExist = gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.DO_BONUS_TOKENS_EXIST); ! hasCompanyLoans = gameUIManager.getGameParameterAsBoolean(GuiDef.Parm.HAS_ANY_COMPANY_LOANS); initButtonPanel(); *************** *** 439,443 **** addField(f, revXOffset, revYOffset + i, 1, 1, 0, visible); f = revenueSelect[i] = new Spinner(0, 0, 0, 10); ! addField(f, revXOffset, revYOffset + i, 1, 1, 0, visible); f = decision[i] = new Field(c.getLastRevenueAllocationModel()); --- 439,444 ---- addField(f, revXOffset, revYOffset + i, 1, 1, 0, visible); f = revenueSelect[i] = new Spinner(0, 0, 0, 10); ! addField(f, revXOffset, revYOffset + i, 1, 1, 0, false); ! revenue[i].addDependent(revenueSelect[i]); f = decision[i] = new Field(c.getLastRevenueAllocationModel()); *************** *** 467,474 **** redoButton.setEnabled(false); - round = orUIManager.gameUIManager.getCurrentRound(); - if (!(round instanceof ShareSellingRound)) { - orUIManager.setORCompanyTurn(-1); - } } --- 468,471 ---- |
From: Erik V. <ev...@us...> - 2010-01-14 20:49:36
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4187/rails/ui/swing Modified Files: GameUIManager.java Log Message: Reworked updateUI() for use of GuiHints Index: GameUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GameUIManager.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** GameUIManager.java 11 Jan 2010 23:06:15 -0000 1.32 --- GameUIManager.java 14 Jan 2010 20:49:22 -0000 1.33 *************** *** 9,13 **** import org.apache.log4j.Logger; ! import rails.common.Defs; import rails.game.*; import rails.game.action.*; --- 9,14 ---- import org.apache.log4j.Logger; ! import rails.common.GuiDef; ! import rails.common.GuiHints; import rails.game.*; import rails.game.action.*; *************** *** 33,42 **** public static ImageLoader imageLoader; ! private GameManagerI gameManager; ! private PossibleAction lastAction; ! private ActionPerformer activeWindow = null; ! private RoundI currentRound; ! private RoundI previousRound = null; ! private StartRound startRound; protected static final String DEFAULT_SAVE_DIRECTORY = "save"; --- 34,49 ---- public static ImageLoader imageLoader; ! protected GameManagerI gameManager; ! protected PossibleAction lastAction; ! protected ActionPerformer activeWindow = null; ! protected StartRound startRound; ! ! protected RoundI currentRound; ! protected RoundI previousRound; ! protected Class<? extends RoundI> previousRoundType = null; ! protected Class<? extends RoundI> currentRoundType = null; ! protected GuiHints uiHints= null; ! protected String previousRoundName; ! protected String currentRoundName; protected static final String DEFAULT_SAVE_DIRECTORY = "save"; *************** *** 54,57 **** --- 61,68 ---- protected File lastFile, lastDirectory; + protected boolean previousStockChartVisibilityHint; + protected boolean previousStatusWindowVisibilityHint; + protected boolean previousORWindowVisibilityHint; + protected static Logger log = Logger.getLogger(GameUIManager.class.getPackage().getName()); *************** *** 65,68 **** --- 76,80 ---- instance = this; this.gameManager = gameManager; + uiHints = gameManager.getUIHints(); saveDirectory = Config.get("save.directory"); *************** *** 98,102 **** orUIManager = orWindow.getORUIManager(); ! String statusWindowClassName = getClassName(Defs.ClassName.STATUS_WINDOW); try { Class<? extends StatusWindow> statusWindowClass = --- 110,114 ---- orUIManager = orWindow.getORUIManager(); ! String statusWindowClassName = getClassName(GuiDef.ClassName.STATUS_WINDOW); try { Class<? extends StatusWindow> statusWindowClass = *************** *** 171,207 **** public void updateUI() { ! currentRound = gameManager.getCurrentRound(); ! log.debug("Current round=" + currentRound + ", previous round=" ! + previousRound); ! // Process consequences of a round type change to the UI ! Class<? extends RoundI> previousRoundType ! = previousRound == null ? null : previousRound.getClass(); ! Class<? extends RoundI> currentRoundType ! = currentRound.getClass(); ! Class<? extends RoundI> previousRoundUItype ! = previousRound == null ? null : previousRound.getRoundTypeForUI(); ! Class<? extends RoundI> currentRoundUItype ! = currentRound.getRoundTypeForUI(); ! /* Distinguish actual round type from visible round type. ! * Actual round type is the class of the active Round subclass. ! * Visible round type is the class of one of the three 'basic' ! * round types: Start, Stock or Operating. ! * The latter type determines what UI windows will become visible. ! */ /* Process actual round type changes */ ! if (previousRound == null || !previousRound.equals(currentRound)) { /* Finish previous round UI processing */ ! if (previousRound != null) { if (StockRound.class.isAssignableFrom(previousRoundType)) { ! log.debug("UI leaving Stock Round"); statusWindow.finishRound(); } else if (StartRound.class.isAssignableFrom(previousRoundType)) { ! log.debug("UI leaving Start Round"); if (startRoundWindow != null) { startRoundWindow.close(); --- 183,209 ---- public void updateUI() { ! previousRoundType = currentRoundType; ! previousRoundName = currentRoundName; ! previousRound = currentRound; ! currentRound = gameManager.getCurrentRound(); ! currentRoundName = currentRound.toString(); ! log.debug("Current round=" + currentRoundName + ", previous round=" ! + previousRoundName); ! currentRoundType = uiHints.getCurrentRoundType(); /* Process actual round type changes */ ! if (previousRoundType != currentRoundType) { /* Finish previous round UI processing */ ! if (previousRoundType != null) { if (StockRound.class.isAssignableFrom(previousRoundType)) { ! log.debug("UI leaving Stock Round "+previousRoundName); statusWindow.finishRound(); } else if (StartRound.class.isAssignableFrom(previousRoundType)) { ! log.debug("UI leaving Start Round "+previousRoundName); if (startRoundWindow != null) { startRoundWindow.close(); *************** *** 209,223 **** } } else if (OperatingRound.class.isAssignableFrom(previousRoundType)) { ! log.debug("UI leaving Operating Round"); orUIManager.finish(); } else if (SwitchableUIRound.class.isAssignableFrom(previousRoundType) ) { ! log.debug("UI leaving switchable round type"); } } // Start the new round UI processing if (StartRound.class.isAssignableFrom(currentRoundType)) { ! log.debug("UI entering Start Round"); startRound = (StartRound) currentRound; if (startRoundWindow == null) { --- 211,229 ---- } } else if (OperatingRound.class.isAssignableFrom(previousRoundType)) { ! log.debug("UI leaving Operating Round "+previousRoundName); orUIManager.finish(); } else if (SwitchableUIRound.class.isAssignableFrom(previousRoundType) ) { ! log.debug("UI leaving switchable round type "+previousRoundName); } } + } + + if (currentRound != previousRound) { + // Start the new round UI processing if (StartRound.class.isAssignableFrom(currentRoundType)) { ! log.debug("UI entering Start Round "+currentRoundName); startRound = (StartRound) currentRound; if (startRoundWindow == null) { *************** *** 227,293 **** } else if (StockRound.class.isAssignableFrom(currentRoundType)) { ! log.debug("UI entering Stock Round"); ! orWindow.setVisible(false); ! stockChart.setVisible(true); } else if (OperatingRound.class.isAssignableFrom(currentRoundType)) { ! log.debug("UI entering Operating Round"); orUIManager.initOR((OperatingRound) currentRound); - orWindow.setVisible(true); - stockChart.setVisible(false); } else if (SwitchableUIRound.class.isAssignableFrom(currentRoundType) ) { ! log.debug("UI entering switchable round type"); ! orWindow.setVisible(true); statusWindow.pack(); - stockChart.setVisible(true); } } /* Process visible round type changes */ - if (previousRoundUItype == null || !previousRoundUItype.equals(currentRoundUItype)) { ! if (previousRoundUItype != null) { ! // Finish the previous round UI aspects ! if (StockRound.class.isAssignableFrom(previousRoundUItype)) { ! log.debug("Leaving Stock Round UI type"); ! } else if (StartRound.class.isAssignableFrom(previousRoundUItype)) { ! log.debug("Leaving Start Round UI type"); ! } else if (OperatingRound.class.isAssignableFrom(previousRoundUItype)) { ! log.debug("Leaving Operating Round UI type"); ! //orWindow.setVisible(false); } ! } ! ! // Start the new round UI aspects ! if (StartRound.class.isAssignableFrom(currentRoundUItype)) { ! log.debug("Entering Start Round UI type"); ! activeWindow = startRoundWindow; ! //stockChart.setVisible(false); ! } else if (StockRound.class.isAssignableFrom(currentRoundUItype)) { ! log.debug("Entering Stock Round UI type"); ! activeWindow = statusWindow; ! //stockChart.setVisible(true); ! //statusWindow.setVisible(true); ! } else if (OperatingRound.class.isAssignableFrom(currentRoundUItype)) { ! log.debug("Entering Operating Round UI type "); ! activeWindow = orWindow; ! //stockChart.setVisible(false); ! //orWindow.setVisible(true); ! } } statusWindow.setupFor(currentRound); - previousRound = currentRound; // Update the currently visible round window // "Switchable" rounds will be handled from subclasses of this class. ! if (StartRound.class.isAssignableFrom(currentRoundUItype)) { log.debug("Updating Start round window"); --- 233,321 ---- } else if (StockRound.class.isAssignableFrom(currentRoundType)) { ! log.debug("UI entering Stock Round "+currentRoundName); } else if (OperatingRound.class.isAssignableFrom(currentRoundType)) { ! log.debug("UI entering Operating Round "+currentRoundName); orUIManager.initOR((OperatingRound) currentRound); } else if (SwitchableUIRound.class.isAssignableFrom(currentRoundType) ) { ! log.debug("UI entering switchable round type "+currentRoundName); statusWindow.pack(); } } /* Process visible round type changes */ ! // Visibility settings are handled first. ! // Any window not represented in a setting is left unaffected. ! // Each window set visible or already being visible will be put ! // in front as well. ! // As the settings are handled in which these have been entered, ! // this means that this way the window top-to-bottom sequence ! // can be influenced. ! // To make this work, clearVisbilityHints() should be called ! // before each sequence of settings (usually at the start of a round). ! for (GuiHints.VisibilityHint hint : uiHints.getVisibilityHints()) { ! switch (hint.getType()) { ! case STOCK_MARKET: ! boolean stockChartVisibilityHint = hint.getVisibility(); ! if (stockChartVisibilityHint != previousStockChartVisibilityHint) { ! stockChart.setVisible(stockChartVisibilityHint); ! previousStockChartVisibilityHint = stockChartVisibilityHint; } ! if (stockChartVisibilityHint) stockChart.toFront(); ! break; ! case STATUS: ! boolean statusWindowVisibilityHint = hint.getVisibility(); ! if (statusWindowVisibilityHint != previousStatusWindowVisibilityHint) { ! statusWindow.setVisible(statusWindowVisibilityHint); ! previousStatusWindowVisibilityHint = statusWindowVisibilityHint; ! } ! if (statusWindowVisibilityHint) statusWindow.toFront(); ! break; ! case MAP: ! boolean orWindowVisibilityHint = hint.getVisibility(); ! if (orWindowVisibilityHint != previousORWindowVisibilityHint) { ! orWindow.setVisible(orWindowVisibilityHint); ! previousORWindowVisibilityHint = orWindowVisibilityHint; ! } ! if (orWindowVisibilityHint) orWindow.toFront(); ! break; ! case START_ROUND: ! // Handled elsewhere ! } ! } ! // Active window settings are handled last. ! // Side effects: the active window is made visible and put on top. ! if (uiHints.getActivePanel() == GuiDef.Panel.START_ROUND) { ! log.debug("Entering Start Round UI type"); ! activeWindow = startRoundWindow; ! startRoundWindow.setVisible(true); ! startRoundWindow.toFront(); ! } else if (uiHints.getActivePanel() == GuiDef.Panel.STATUS) { ! log.debug("Entering Stock Round UI type"); ! activeWindow = statusWindow; ! statusWindow.setVisible(true); ! statusWindow.toFront(); ! } else if (uiHints.getActivePanel() == GuiDef.Panel.MAP) { ! log.debug("Entering Operating Round UI type "); ! activeWindow = orWindow; ! orWindow.setVisible(true); ! orWindow.toFront(); } + + statusWindow.setupFor(currentRound); // Update the currently visible round window // "Switchable" rounds will be handled from subclasses of this class. ! if (StartRoundWindow.class.isAssignableFrom(activeWindow.getClass())) { log.debug("Updating Start round window"); *************** *** 295,320 **** startRoundWindow.setSRPlayerTurn(startRound.getCurrentPlayerIndex()); ! } else if (StockRound.class.isAssignableFrom(currentRoundUItype)) { log.debug("Updating Stock (status) round window"); statusWindow.updateStatus(); ! } else if (OperatingRound.class.isAssignableFrom(currentRoundUItype)) { log.debug("Updating Operating round window"); orUIManager.updateStatus(); - - } else { - // Handle special rounds that do not fall in a standard category - // The round must indicate which main window to raise - if (StockRound.class.isAssignableFrom(currentRoundUItype)) { - log.debug("Updating switched Stock (status) round window"); - activeWindow = statusWindow; - } else if (OperatingRound.class.isAssignableFrom(currentRoundUItype)) { - log.debug("Updating switched Operating round window"); - activeWindow = orWindow; - } - updateStatus(activeWindow); } } --- 323,338 ---- startRoundWindow.setSRPlayerTurn(startRound.getCurrentPlayerIndex()); ! } else if (StatusWindow.class.isAssignableFrom(activeWindow.getClass())) { log.debug("Updating Stock (status) round window"); statusWindow.updateStatus(); ! } else if (ORWindow.class.isAssignableFrom(activeWindow.getClass())) { log.debug("Updating Operating round window"); orUIManager.updateStatus(); } + + updateStatus(activeWindow); } *************** *** 615,627 **** } ! public String getClassName (Defs.ClassName key) { return gameManager.getClassName(key); } ! public Object getGameParameter (Defs.Parm key) { ! return gameManager.getGameParameter(key); } ! public boolean getGameParameterAsBoolean (Defs.Parm key) { return (Boolean) getGameParameter(key); } --- 633,645 ---- } ! public String getClassName (GuiDef.ClassName key) { return gameManager.getClassName(key); } ! public Object getGameParameter (GuiDef.Parm key) { ! return gameManager.getGuiParameter(key); } ! public boolean getGameParameterAsBoolean (GuiDef.Parm key) { return (Boolean) getGameParameter(key); } |
From: Erik V. <ev...@us...> - 2010-01-14 20:48:34
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3952/rails/ui/swing Modified Files: GridPanel.java Log Message: Propagate row invisibility to ClickButtons Index: GridPanel.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/GridPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GridPanel.java 5 Jan 2010 20:54:05 -0000 1.1 --- GridPanel.java 14 Jan 2010 20:48:26 -0000 1.2 *************** *** 14,17 **** --- 14,18 ---- import rails.game.model.ModelObject; import rails.game.state.BooleanState; + import rails.ui.swing.elements.Field; import rails.ui.swing.elements.ViewObject; *************** *** 116,122 **** public void setRowVisibility (int rowIndex, boolean value) { ! for (int j=0; j < fields.length; j++) { if (fields[j][rowIndex] != null) { fields[j][rowIndex].setVisible(value); } } --- 117,131 ---- public void setRowVisibility (int rowIndex, boolean value) { ! List<JComponent> dependents; ! ! for (int j=0; j < fields.length; j++) { if (fields[j][rowIndex] != null) { fields[j][rowIndex].setVisible(value); + if (fields[j][rowIndex] instanceof Field + && (dependents = ((Field)fields[j][rowIndex]).getDependents()) != null) { + for (JComponent dependent : dependents) { + dependent.setVisible(value); + } + } } } |
From: Erik V. <ev...@us...> - 2010-01-14 20:47:07
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3623/rails/ui/swing Modified Files: ORUIManager.java Log Message: Fixed company turn change issue Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** ORUIManager.java 11 Jan 2010 23:06:14 -0000 1.44 --- ORUIManager.java 14 Jan 2010 20:46:59 -0000 1.45 *************** *** 109,114 **** public void finish() { orWindow.finish(); ! orWindow.setVisible(false); ! } --- 109,115 ---- public void finish() { orWindow.finish(); ! if (!(gameUIManager.getCurrentRound() instanceof ShareSellingRound)) { ! setORCompanyTurn(-1); ! } } *************** *** 1138,1142 **** orStep = oRound.getStep(); orComp = oRound.getOperatingCompany(); ! log.debug("Or comp index = " + orCompIndex); log.debug("OR company = " + orComp.getName()); log.debug("OR step=" + orStep + " " --- 1139,1143 ---- orStep = oRound.getStep(); orComp = oRound.getOperatingCompany(); ! log.debug("Or comp index = " + orCompIndex+" in round "+oRound.getRoundName()); log.debug("OR company = " + orComp.getName()); log.debug("OR step=" + orStep + " " *************** *** 1335,1340 **** public void setORCompanyTurn(int orCompIndex) { - orPanel.resetORCompanyTurn(orCompIndex); - this.orCompIndex = orCompIndex; orComp = orCompIndex >= 0 ? companies[orCompIndex] : null; --- 1336,1339 ---- |
From: Erik V. <ev...@us...> - 2010-01-14 20:45:58
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3504/rails/ui/swing/elements Modified Files: Field.java Log Message: Added dependents to propagate updates Index: Field.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/elements/Field.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Field.java 13 Dec 2009 16:39:49 -0000 1.9 --- Field.java 14 Jan 2010 20:45:43 -0000 1.10 *************** *** 4,8 **** import java.awt.Color; import java.awt.Graphics; ! import java.util.Observable; import javax.swing.*; --- 4,8 ---- import java.awt.Color; import java.awt.Graphics; ! import java.util.*; import javax.swing.*; *************** *** 26,29 **** --- 26,31 ---- private Color normalBgColour = NORMAL_BG_COLOUR; + private List<JComponent> dependents = null; + private boolean pull = false; *************** *** 116,122 **** /** Needed to satisfy the ViewObject interface. Currently not used. */ public void deRegister() { ! if (modelObject != null) ! modelObject.deleteObserver(this); } } --- 118,134 ---- /** Needed to satisfy the ViewObject interface. Currently not used. */ public void deRegister() { ! if (modelObject != null) modelObject.deleteObserver(this); ! dependents = null; ! } ! ! public void addDependent (JComponent dependent) { ! if (dependents == null) dependents = new ArrayList<JComponent>(2); ! dependents.add(dependent); } + public List<JComponent> getDependents () { + return dependents; + } + + } |
From: Erik V. <ev...@us...> - 2010-01-14 20:45:17
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3465/rails/ui/swing/elements Modified Files: CheckBoxDialog.java Log Message: Added alwaysOnTop() Index: CheckBoxDialog.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/elements/CheckBoxDialog.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CheckBoxDialog.java 8 Jan 2010 21:27:54 -0000 1.5 --- CheckBoxDialog.java 14 Jan 2010 20:45:09 -0000 1.6 *************** *** 70,74 **** setVisible(true); ! } --- 70,74 ---- setVisible(true); ! setAlwaysOnTop(true); } *************** *** 91,96 **** checkBoxes = new JCheckBox[numOptions]; ! this.getContentPane().setLayout(new GridBagLayout()); ! this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); optionsPane.setLayout(new GridBagLayout()); --- 91,96 ---- checkBoxes = new JCheckBox[numOptions]; ! getContentPane().setLayout(new GridBagLayout()); ! setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); optionsPane.setLayout(new GridBagLayout()); |
From: Erik V. <ev...@us...> - 2010-01-14 20:44:53
|
Update of /cvsroot/rails/18xx/rails/ui/swing/elements In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3371/rails/ui/swing/elements Modified Files: RadioButtonDialog.java Log Message: Fixed and added alwaysOnTop() Index: RadioButtonDialog.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/elements/RadioButtonDialog.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RadioButtonDialog.java 11 Jan 2010 23:06:21 -0000 1.6 --- RadioButtonDialog.java 14 Jan 2010 20:44:45 -0000 1.7 *************** *** 59,63 **** setLocation(x, y); ! this.setVisible(true); } --- 59,64 ---- setLocation(x, y); ! setVisible(true); ! setAlwaysOnTop(true); } *************** *** 83,88 **** choiceButtons = new JRadioButton[numOptions]; ! this.getContentPane().setLayout(new GridBagLayout()); ! this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); optionsPane.setLayout(new GridBagLayout()); --- 84,89 ---- choiceButtons = new JRadioButton[numOptions]; ! getContentPane().setLayout(new GridBagLayout()); ! setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); optionsPane.setLayout(new GridBagLayout()); *************** *** 129,133 **** } } else if (arg0.getSource().equals(cancelButton)) { ! return; } this.setVisible(false); --- 130,134 ---- } } else if (arg0.getSource().equals(cancelButton)) { ! chosenOption = -1; } this.setVisible(false); |
From: Erik V. <ev...@us...> - 2010-01-14 20:44:13
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3333/rails/ui/swing/gamespecific/_18EU Modified Files: GameStatus_18EU.java Log Message: Changes related to non-modal dialogs Index: GameStatus_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU/GameStatus_18EU.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GameStatus_18EU.java 11 Jan 2010 23:06:18 -0000 1.9 --- GameStatus_18EU.java 14 Jan 2010 20:44:04 -0000 1.10 *************** *** 4,12 **** import java.util.List; - import rails.game.City; import rails.game.PublicCompanyI; import rails.game.action.MergeCompanies; import rails.game.action.PossibleAction; - import rails.game.specific._18EU.StartCompany_18EU; import rails.ui.swing.GameStatus; import rails.ui.swing.elements.RadioButtonDialog; --- 4,10 ---- *************** *** 82,136 **** } - /** Start a company - specific procedure for 18EU */ - @Override - protected PossibleAction processGameSpecificFollowUpActions( - ActionEvent actor, PossibleAction chosenAction) { - - if (chosenAction instanceof StartCompany_18EU) { - - StartCompany_18EU action = (StartCompany_18EU) chosenAction; - List<PublicCompanyI> minors = // - ((StartCompany_18EU) chosenAction).getMinorsToMerge(); - - if (minors != null && !minors.isEmpty()) { - // Up to phase 6, a minor must be exchanged - String[] options = new String[minors.size()]; - int i = 0; - for (PublicCompanyI minor : minors) { - options[i++] = - "Minor " + minor.getName() + " " - + minor.getLongName(); - } - RadioButtonDialog dialog = new RadioButtonDialog (gameUIManager, - LocalText.getText("PleaseSelect"), - LocalText.getText( - "SelectMinorToMerge", - action.getCertificate().getCompany().getName()), - options, -1); - gameUIManager.setCurrentDialog(dialog, action); - return null; - } else { - - // From phase 6, no minors are involved, but a home station must be chosen - List<City> cities = action.getAvailableHomeStations(); - if (cities != null && !cities.isEmpty()) { - String[] options = new String[cities.size()]; - for (int i = 0; i < options.length; i++) { - options[i] = cities.get(i).toString(); - } - RadioButtonDialog dialog = new RadioButtonDialog (gameUIManager, - LocalText.getText("PleaseSelect"), - LocalText.getText( - "SelectMinorToMerge", - action.getCertificate().getCompany().getName()), - options, -1); - gameUIManager.setCurrentDialog(dialog, action); - return null; - - } - } - } - return chosenAction; - } } --- 80,83 ---- |
From: Erik V. <ev...@us...> - 2010-01-14 20:43:28
|
Update of /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3214/rails/ui/swing/gamespecific/_18EU Modified Files: GameUIManager_18EU.java Log Message: Changes related to non-modal dialogs Index: GameUIManager_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/gamespecific/_18EU/GameUIManager_18EU.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GameUIManager_18EU.java 11 Jan 2010 23:06:17 -0000 1.1 --- GameUIManager_18EU.java 14 Jan 2010 20:43:18 -0000 1.2 *************** *** 1,6 **** --- 1,9 ---- package rails.ui.swing.gamespecific._18EU; + import java.util.List; + import javax.swing.JOptionPane; + import rails.game.City; import rails.game.PublicCompanyI; import rails.game.action.MergeCompanies; *************** *** 51,71 **** StartCompany_18EU action = (StartCompany_18EU) currentDialogAction; ! if (action.getMinorsToMerge() != null) { // Up to phase 5: a minor to merge has been selected (or not) int choice = dialog.getSelectedOption(); ! if (choice >= 0) { ! action.setChosenMinor(action.getMinorsToMerge().get(choice)); ! } else { ! return; } } else if (action.getAvailableHomeStations() != null) { // From phase 6: a home station has been selected (or not) int index = dialog.getSelectedOption(); ! if (index >= 0) { ! action.setHomeStation(action.getAvailableHomeStations().get(index)); ! } else { ! return; } } } else { --- 54,124 ---- StartCompany_18EU action = (StartCompany_18EU) currentDialogAction; ! if (action.getPrice() == 0) { ! ! // The price will be set first ! int index = dialog.getSelectedOption(); ! if (index < 0) return; ! action.setStartPrice(action.getStartPrices()[index]); ! ! // Set up another dialog for the next step ! List<PublicCompanyI> minors = action.getMinorsToMerge(); ! ! if (minors != null && !minors.isEmpty()) { ! // Up to phase 6, a minor must be exchanged ! String[] options = new String[minors.size()]; ! int i = 0; ! for (PublicCompanyI minor : minors) { ! options[i++] = ! "Minor " + minor.getName() + " " ! + minor.getLongName(); ! } ! dialog = new RadioButtonDialog (this, ! LocalText.getText("PleaseSelect"), ! LocalText.getText( ! "SelectMinorToMerge", ! action.getCertificate().getCompany().getName()), ! options, -1); ! setCurrentDialog(dialog, action); ! return; ! } else { ! ! // From phase 6, no minors are involved, but a home station must be chosen ! List<City> cities = action.getAvailableHomeStations(); ! if (cities != null && !cities.isEmpty()) { ! String[] options = new String[cities.size()]; ! for (int i = 0; i < options.length; i++) { ! options[i] = cities.get(i).toString(); ! } ! dialog = new RadioButtonDialog (this, ! LocalText.getText("PleaseSelect"), ! LocalText.getText( ! "SelectHomeStation", ! action.getCertificate().getCompany().getName()), ! options, -1); ! setCurrentDialog(dialog, action); ! return; ! ! } ! } ! } else if (action.getMinorsToMerge() != null) { // Up to phase 5: a minor to merge has been selected (or not) int choice = dialog.getSelectedOption(); ! if (choice < 0) { ! // Also reset price ! action.setStartPrice(0); ! return; } + action.setChosenMinor(action.getMinorsToMerge().get(choice)); + } else if (action.getAvailableHomeStations() != null) { // From phase 6: a home station has been selected (or not) int index = dialog.getSelectedOption(); ! if (index < 0) { ! // Also reset price ! action.setStartPrice(0); ! return; } + action.setHomeStation(action.getAvailableHomeStations().get(index)); } } else { |
From: Erik V. <ev...@us...> - 2010-01-14 20:41:56
|
Update of /cvsroot/rails/18xx/rails/game In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3080/rails/game Removed Files: SpecialPropertyHolderI.java Log Message: Removed because unused --- SpecialPropertyHolderI.java DELETED --- |