From: <ev...@us...> - 2010-08-22 15:47:07
|
Revision: 1401 http://rails.svn.sourceforge.net/rails/?rev=1401&view=rev Author: evos Date: 2010-08-22 15:47:01 +0000 (Sun, 22 Aug 2010) Log Message: ----------- Reset 'operated' flag when making a bankrupted 18EU major restartable. Modified Paths: -------------- trunk/18xx/rails/game/PublicCompany.java Modified: trunk/18xx/rails/game/PublicCompany.java =================================================================== --- trunk/18xx/rails/game/PublicCompany.java 2010-08-22 15:32:27 UTC (rev 1400) +++ trunk/18xx/rails/game/PublicCompany.java 2010-08-22 15:47:01 UTC (rev 1401) @@ -829,16 +829,16 @@ public void setHomeCityNumber(int number) { this.homeCityNumber = number; } - + /** * @return true -> requires an open slot in each city of the hex, false -> one slot on the hex - * + * */ public boolean isHomeBlockedForAllCities() { return homeAllCitiesBlocked; } - + /** * @return Returns the destinationHex. */ @@ -1035,6 +1035,7 @@ protected void reinitialise () { hasStarted.set(false); hasFloated.set(false); + hasOperated.set(false); if (parPrice != null && fixedPrice <= 0) parPrice.setPrice(null); if (currentPrice != null) currentPrice.setPrice(null); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2010-09-06 17:39:53
|
Revision: 1412 http://rails.svn.sourceforge.net/rails/?rev=1412&view=rev Author: evos Date: 2010-09-06 17:39:47 +0000 (Mon, 06 Sep 2010) Log Message: ----------- Fix: closing company (1856) to transfer trains and cash Modified Paths: -------------- trunk/18xx/rails/game/PublicCompany.java Modified: trunk/18xx/rails/game/PublicCompany.java =================================================================== --- trunk/18xx/rails/game/PublicCompany.java 2010-08-28 18:52:52 UTC (rev 1411) +++ trunk/18xx/rails/game/PublicCompany.java 2010-09-06 17:39:47 UTC (rev 1412) @@ -1017,6 +1017,13 @@ } } + // Any trains go to the pool (from the 1856 rules) + Util.moveObjects(portfolio.getTrainList(), bank.getPool()); + + // Any cash goes to the bank (from the 1856 rules) + int cash = treasury.getCash(); + if (cash > 0) new CashMove (this, bank, cash); + lastRevenue.setOption(MoneyModel.SUPPRESS_ZERO); setLastRevenue(0); treasury.setOption(CashModel.SUPPRESS_ZERO); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-07-07 12:59:01
|
Revision: 1609 http://rails.svn.sourceforge.net/rails/?rev=1609&view=rev Author: evos Date: 2011-07-07 12:58:55 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Fixed: 1856 THB home hex: if there is a foreign token on L15 when THB starts, home hex was not laid in first OR. Modified Paths: -------------- trunk/18xx/rails/game/PublicCompany.java Modified: trunk/18xx/rails/game/PublicCompany.java =================================================================== --- trunk/18xx/rails/game/PublicCompany.java 2011-07-07 04:56:55 UTC (rev 1608) +++ trunk/18xx/rails/game/PublicCompany.java 2011-07-07 12:58:55 UTC (rev 1609) @@ -1818,9 +1818,24 @@ Map<Integer, List<Track>> tracks = homeHex.getCurrentTile().getTracksPerStationMap(); if (tracks == null || tracks.isEmpty()) { + // No tracks, then it doesn't matter homeCityNumber = 1; } else { - return false; + // Cover the case that there already is another token. + // Allowing this is optional for 1856 Hamilton (THB home) + List<City> cities = homeHex.getCities(); + List<City> openCities = new ArrayList<City>(); + for (City city : cities) { + if (city.hasTokenSlotsLeft()) openCities.add (city); + } + if (openCities.size() == 1) { + // Just one spot: lay the home base there. + homeCityNumber = openCities.get(0).getNumber(); + } else { + // ?? + // TODO Will player be asked?? + return false; + } } } log.debug(name + " lays home base on " + homeHex.getName() + " city " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |