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
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
|
2
|
3
|
4
|
5
(1) |
|
6
(2) |
7
|
8
|
9
|
10
|
11
|
12
|
|
13
|
14
(4) |
15
(1) |
16
|
17
(1) |
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
(2) |
|
27
|
28
|
29
(1) |
30
(1) |
31
|
|
|
|
From: <ev...@us...> - 2011-03-30 14:57:20
|
Revision: 1504
http://rails.svn.sourceforge.net/rails/?rev=1504&view=rev
Author: evos
Date: 2011-03-30 14:57:13 +0000 (Wed, 30 Mar 2011)
Log Message:
-----------
Autosave/load, fixes and small improvements
Modified Paths:
--------------
trunk/18xx/rails/ui/swing/AutoLoadPoller.java
trunk/18xx/rails/ui/swing/GameSetupWindow.java
trunk/18xx/rails/ui/swing/GameStatus.java
trunk/18xx/rails/ui/swing/GameUIManager.java
trunk/18xx/rails/ui/swing/ORUIManager.java
trunk/18xx/rails/ui/swing/ORWindow.java
trunk/18xx/rails/ui/swing/ReportWindowDynamic.java
trunk/18xx/rails/ui/swing/StartRoundWindow.java
trunk/18xx/rails/ui/swing/StatusWindow.java
trunk/18xx/rails/ui/swing/gamespecific/_18EU/StatusWindow_18EU.java
trunk/18xx/rails/util/RunGame.java
Modified: trunk/18xx/rails/ui/swing/AutoLoadPoller.java
===================================================================
--- trunk/18xx/rails/ui/swing/AutoLoadPoller.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/AutoLoadPoller.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -42,6 +42,9 @@
lastSavedFilenameFilepath = saveDirectory + "/" + savePrefix + ".last_rails";
+ log.debug("Poller own postfix: "+ownPostfix);
+ log.debug("Poller last-filename path: "+lastSavedFilenameFilepath);
+
}
@Override
@@ -54,7 +57,7 @@
for (;;) {
- log.debug ("Polling cycle");
+ log.debug ("Polling cycle, status="+pollingStatus+" active="+pollingActive);
// Process
if (pollingActive && pollingStatus == ON) {
log.debug("Polling...");
@@ -72,14 +75,14 @@
// The GUI must be accessed on the event dispatch thread only.
SwingUtilities.invokeLater (new Runnable() {
public void run() {
- guiMgr.processOnServer(reload);
+ guiMgr.processAction(reload);
}
});
}
} catch (IOException e) {
-
+ log.error("Exception whilst polling "+lastSavedFilenameFilepath, e);
}
}
Modified: trunk/18xx/rails/ui/swing/GameSetupWindow.java
===================================================================
--- trunk/18xx/rails/ui/swing/GameSetupWindow.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/GameSetupWindow.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -218,7 +218,7 @@
JOptionPane.showMessageDialog(this,
DisplayBuffer.get(), "", JOptionPane.ERROR_MESSAGE);
}
- startGameUIManager(game);
+ startGameUIManager(game, true);
if (saveDirectory != null) {
gameUIManager.setSaveDirectory (saveDirectory);
}
@@ -494,7 +494,7 @@
JOptionPane.ERROR_MESSAGE);
System.exit(-1);
}
- startGameUIManager (game);
+ startGameUIManager (game, false);
gameUIManager.gameUIInit(true); // true indicates new game
}
@@ -503,14 +503,14 @@
killConfigWindow();
}
- private void startGameUIManager(Game game) {
+ private void startGameUIManager(Game game, boolean wasLoaded) {
GameManagerI gameManager = game.getGameManager();
String gameUIManagerClassName = gameManager.getClassName(GuiDef.ClassName.GAME_UI_MANAGER);
try {
Class<? extends GameUIManager> gameUIManagerClass =
Class.forName(gameUIManagerClassName).asSubclass(GameUIManager.class);
gameUIManager = gameUIManagerClass.newInstance();
- gameUIManager.init(gameManager);
+ gameUIManager.init(gameManager, wasLoaded);
} catch (Exception e) {
log.fatal("Cannot instantiate class " + gameUIManagerClassName, e);
System.exit(1);
Modified: trunk/18xx/rails/ui/swing/GameStatus.java
===================================================================
--- trunk/18xx/rails/ui/swing/GameStatus.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/GameStatus.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -758,8 +758,8 @@
ActionEvent actor, PossibleAction chosenAction) {
return chosenAction;
}
-
- public void initTurn(int actorIndex) {
+
+ public void initTurn(int actorIndex, boolean myTurn) {
int i, j;
dummyButton.setSelected(true);
@@ -791,56 +791,58 @@
} else if (j == -1 && treasurySharesCaption != null) {
treasurySharesCaption.setHighlight(true);
}
+
+ if (myTurn) {
- PublicCompanyI company;
- Portfolio holder;
- int index;
- CashHolder owner;
-
- List<BuyCertificate> buyableCerts =
- possibleActions.getType(BuyCertificate.class);
- if (buyableCerts != null) {
- for (BuyCertificate bCert : buyableCerts) {
- company = bCert.getCompany();
- index = company.getPublicNumber();
- holder = bCert.getFromPortfolio();
- owner = holder.getOwner();
- if (holder == ipo) {
- setIPOCertButton(index, true, bCert);
- } else if (holder == pool) {
- setPoolCertButton(index, true, bCert);
- } else if (owner instanceof Player) {
- setPlayerCertButton(index, ((Player)owner).getIndex(), true, bCert);
- } else if (owner instanceof PublicCompanyI && compCanHoldOwnShares) {
- setTreasuryCertButton(index, true, bCert);
+ PublicCompanyI company;
+ Portfolio holder;
+ int index;
+ CashHolder owner;
+
+ List<BuyCertificate> buyableCerts =
+ possibleActions.getType(BuyCertificate.class);
+ if (buyableCerts != null) {
+ for (BuyCertificate bCert : buyableCerts) {
+ company = bCert.getCompany();
+ index = company.getPublicNumber();
+ holder = bCert.getFromPortfolio();
+ owner = holder.getOwner();
+ if (holder == ipo) {
+ setIPOCertButton(index, true, bCert);
+ } else if (holder == pool) {
+ setPoolCertButton(index, true, bCert);
+ } else if (owner instanceof Player) {
+ setPlayerCertButton(index, ((Player)owner).getIndex(), true, bCert);
+ } else if (owner instanceof PublicCompanyI && compCanHoldOwnShares) {
+ setTreasuryCertButton(index, true, bCert);
+ }
}
}
- }
-
- List<SellShares> sellableShares =
- possibleActions.getType(SellShares.class);
- if (sellableShares != null) {
- for (SellShares share : sellableShares) {
- company = share.getCompany();
- index = company.getPublicNumber();
- if (j >= 0) {
- setPlayerCertButton(index, j, true, share);
- } else if (j == -1 && compCanHoldOwnShares) {
- setTreasuryCertButton(index, true, share);
+
+ List<SellShares> sellableShares =
+ possibleActions.getType(SellShares.class);
+ if (sellableShares != null) {
+ for (SellShares share : sellableShares) {
+ company = share.getCompany();
+ index = company.getPublicNumber();
+ if (j >= 0) {
+ setPlayerCertButton(index, j, true, share);
+ } else if (j == -1 && compCanHoldOwnShares) {
+ setTreasuryCertButton(index, true, share);
+ }
}
}
- }
-
- initGameSpecificActions();
-
- List<NullAction> nullActions =
- possibleActions.getType(NullAction.class);
- if (nullActions != null) {
- for (NullAction na : nullActions) {
- (parent).setPassButton(na);
+
+ initGameSpecificActions();
+
+ List<NullAction> nullActions =
+ possibleActions.getType(NullAction.class);
+ if (nullActions != null) {
+ for (NullAction na : nullActions) {
+ (parent).setPassButton(na);
+ }
}
}
-
}
repaint();
Modified: trunk/18xx/rails/ui/swing/GameUIManager.java
===================================================================
--- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -74,6 +74,9 @@
protected boolean myTurn = true;
protected String lastSavedFilenameFilepath;
protected String lastSavedFilename = "";
+ protected String localPlayerName = "";
+
+ protected boolean gameWasLoaded = false;
protected WindowSettings windowSettings;
@@ -92,12 +95,13 @@
}
- public void init (GameManagerI gameManager) {
+ public void init (GameManagerI gameManager, boolean wasLoaded) {
instance = this;
this.gameManager = gameManager;
uiHints = gameManager.getUIHints();
savePrefix = gameManager.getGameName();
+ gameWasLoaded = wasLoaded;
initWindowSettings();
initSaveSettings();
@@ -147,6 +151,7 @@
} else {
saveSuffix = getPlayerNames().get(0);
}
+ log.debug("Initial save suffix: "+saveSuffix);
}
private void initFontSettings() {
@@ -219,11 +224,11 @@
public void startLoadedGame() {
gameUIInit(false); // false indicates reload
- processOnServer(new NullAction(NullAction.START_GAME));
+ processAction(new NullAction(NullAction.START_GAME));
statusWindow.setGameActions();
}
- public boolean processOnServer(PossibleAction action) {
+ public boolean processAction(PossibleAction action) {
boolean result = true;
@@ -237,42 +242,36 @@
result = previousResult;
} else {
- action.setActed();
- action.setPlayerName(getCurrentPlayer().getName());
+
+ Player oldPlayer = getCurrentPlayer();
+ boolean wasMyTurn = oldPlayer.getName().equals(localPlayerName);
- log.debug("==Passing to server: " + action);
-
- Player player = getCurrentPlayer();
- if (player != null) {
- action.setPlayerName(player.getName());
- }
-
// Process the action on the server
- result = previousResult = gameManager.process(action);
+ result = previousResult = processOnServer (action);
- // Follow-up the result
- log.debug("==Result from server: " + result);
- reportWindow.updateLog();
-
// Process any autosaving and turn relinquishing, resp. autoloading and turn pickup
if (autoSaveLoadInitialized && autoSaveLoadStatus != AutoLoadPoller.OFF) {
Player newPlayer = getCurrentPlayer();
- boolean wasMyTurn = myTurn;
- myTurn = newPlayer.getName().equals(saveSuffix);
- if (newPlayer != player) {
- if (wasMyTurn && !myTurn) {
- log.info ("Relinquishing turn to "+newPlayer.getName());
+ boolean isMyTurn = newPlayer.getName().equals(localPlayerName);
+ if (newPlayer != oldPlayer) {
+ if (wasMyTurn && !isMyTurn) {
autoSave (newPlayer.getName());
autoLoadPoller.setLastSavedFilename(lastSavedFilename);
autoLoadPoller.setActive(true);
- } else if (!wasMyTurn && myTurn) {
- log.info ("Resuming turn as "+saveSuffix);
+ log.info ("Relinquishing turn to "+newPlayer.getName());
+ } else if (!wasMyTurn && isMyTurn) {
autoLoadPoller.setActive(false);
setCurrentDialog(new MessageDialog(this,
LocalText.getText("Message"),
- LocalText.getText("YourTurn", saveSuffix)),
+ LocalText.getText("YourTurn", localPlayerName)),
null);
- }
+ log.info ("Resuming turn as "+localPlayerName);
+ } else {
+ log.info(newPlayer.getName()+" now has the turn");
+ }
+ myTurn = isMyTurn;
+ } else {
+ log.info(oldPlayer.getName()+" keeps the turn");
}
}
}
@@ -301,6 +300,30 @@
return activeWindow.processImmediateAction();
}
+ protected boolean processOnServer (PossibleAction action) {
+
+ boolean result;
+
+ action.setActed();
+ action.setPlayerName(getCurrentPlayer().getName());
+
+ log.debug("==Passing to server: " + action);
+
+ Player player = getCurrentPlayer();
+ if (player != null) {
+ action.setPlayerName(player.getName());
+ }
+
+ // Process the action on the server
+ result = gameManager.process(action);
+
+ // Follow-up the result
+ log.debug("==Result from server: " + result);
+ reportWindow.updateLog();
+
+ return result;
+ }
+
public boolean displayServerMessage() {
String[] message = DisplayBuffer.get();
if (message != null) {
@@ -674,7 +697,7 @@
}
}
- if (currentDialogAction != null) processOnServer(currentDialogAction);
+ if (currentDialogAction != null) processAction(currentDialogAction);
}
@@ -773,7 +796,7 @@
providedName = filepath;
}
exportAction.setFilepath(filepath);
- processOnServer(exportAction);
+ processAction(exportAction);
}
}
@@ -790,13 +813,16 @@
if (providedName != null) {
filename = providedName;
} else {
+ String currentSuffix;
if (NEXT_PLAYER_SUFFIX.equals(saveSuffixSpec)) {
- saveSuffix = gameManager.getCurrentPlayer().getName().replaceAll("[^-\\w\\.]", "_");
+ currentSuffix = getCurrentPlayer().getName().replaceAll("[^-\\w\\.]", "_");
+ } else {
+ currentSuffix = saveSuffix;
}
filename =
saveDirectory + "/" + savePrefix + "_"
+ saveDateTimeFormat.format(new Date()) + "_"
- + saveSuffix + "."
+ + currentSuffix + "."
+ saveExtension;
}
@@ -824,7 +850,7 @@
}
}
saveAction.setFilepath(filepath);
- processOnServer(saveAction);
+ processAction(saveAction);
}
}
@@ -838,7 +864,7 @@
File selectedFile = jfc.getSelectedFile();
saveDirectory = selectedFile.getParent();
reloadAction.setFilepath(selectedFile.getPath());
- processOnServer(reloadAction);
+ processAction(reloadAction);
} else { // cancel pressed
return;
}
@@ -847,6 +873,16 @@
public void autoSaveLoadGame () {
+ localPlayerName = System.getProperty("local.player.name");
+ if (!Util.hasValue(localPlayerName)) {
+ localPlayerName = Config.get("local.player.name");
+ }
+ if (!Util.hasValue(localPlayerName)) {
+ DisplayBuffer.add("You cannot activate AutoSave/Load without setting local.player.name");
+ return;
+ }
+ log.debug("Polling local player name: "+localPlayerName);
+
AutoSaveLoadDialog dialog = new AutoSaveLoadDialog (this,
autoSaveLoadStatus,
autoSaveLoadPollingInterval);
@@ -859,8 +895,9 @@
autoSaveLoadPollingInterval = dialog.getInterval();
if (autoLoadPoller == null && autoSaveLoadStatus > 0) {
+
autoLoadPoller = new AutoLoadPoller (this, saveDirectory, savePrefix,
- saveSuffix, autoSaveLoadStatus, autoSaveLoadPollingInterval);
+ localPlayerName, autoSaveLoadStatus, autoSaveLoadPollingInterval);
autoLoadPoller.start();
} else if (autoLoadPoller != null) {
autoLoadPoller.setStatus(autoSaveLoadStatus);
@@ -869,14 +906,20 @@
log.debug("AutoSaveLoad parameters: status="+autoSaveLoadStatus
+" interval="+autoSaveLoadPollingInterval);
+ if (gameWasLoaded) {
+ autoSaveLoadInitialized = true;
+ lastSavedFilenameFilepath = saveDirectory + "/" + savePrefix + ".last_rails";
+ }
+
if (autoLoadPoller != null && autoSaveLoadStatus != AutoLoadPoller.OFF
- && !autoSaveLoadInitialized) {
+ && !autoSaveLoadInitialized && !gameWasLoaded) {
/* The first time (only) we use the normal save process,
* so the player can select a directory, and change
* the prefix if so desired.
*/
GameAction saveAction = new GameAction(GameAction.SAVE);
+ saveSuffix = localPlayerName;
saveGame (saveAction);
File lastSavedFile = new File (saveAction.getFilepath());
saveDirectory = lastSavedFile.getParentFile().getPath();
@@ -896,7 +939,7 @@
}
}
- myTurn = getCurrentPlayer().getName().equals(saveSuffix);
+ myTurn = getCurrentPlayer().getName().equals(localPlayerName);
if (!myTurn) {
// Start autoload polling
@@ -911,6 +954,7 @@
}
+ /*
public boolean isMyTurn() {
return myTurn;
}
@@ -918,6 +962,7 @@
public void setMyTurn(boolean myTurn) {
this.myTurn = myTurn;
}
+ */
public void setSaveDirectory(String saveDirectory) {
this.saveDirectory = saveDirectory;
Modified: trunk/18xx/rails/ui/swing/ORUIManager.java
===================================================================
--- trunk/18xx/rails/ui/swing/ORUIManager.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/ORUIManager.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -450,7 +450,7 @@
} else if (actionType == ClosePrivate.class) {
- gameUIManager.processOnServer(actions.get(0));
+ gameUIManager.processAction(actions.get(0));
}
@@ -581,7 +581,7 @@
return;
}
- gameUIManager.processOnServer(currentDialogAction);
+ gameUIManager.processAction(currentDialogAction);
}
public JDialog getCurrentDialog() {
@@ -1432,13 +1432,13 @@
/* In fact currently not used */
protected void useSpecialProperty (UseSpecialProperty action) {
- gameUIManager.processOnServer(action);
+ gameUIManager.processAction(action);
}
protected void processCorrectionAction(CorrectionAction action) {
- gameUIManager.processOnServer(action);
+ gameUIManager.processAction(action);
}
Modified: trunk/18xx/rails/ui/swing/ORWindow.java
===================================================================
--- trunk/18xx/rails/ui/swing/ORWindow.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/ORWindow.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -151,7 +151,7 @@
// Add the actor for safety checking in the server
if (action != null) action.setPlayerName(orPanel.getORPlayer());
// Process the action
- boolean result = gameUIManager.processOnServer(action);
+ boolean result = gameUIManager.processAction(action);
// Display any error message
//displayServerMessage();
Modified: trunk/18xx/rails/ui/swing/ReportWindowDynamic.java
===================================================================
--- trunk/18xx/rails/ui/swing/ReportWindowDynamic.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/ReportWindowDynamic.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -206,7 +206,7 @@
}
- gameUIManager.processOnServer(action);
+ gameUIManager.processAction(action);
}
public void hyperlinkUpdate(HyperlinkEvent e) {
@@ -231,11 +231,11 @@
if (index > currentIndex) { // move forward
GameAction action = new GameAction(GameAction.REDO);
action.setmoveStackIndex(index);
- gameUIManager.processOnServer(action);
+ gameUIManager.processAction(action);
} else if (index < currentIndex) { // move backward
GameAction action = new GameAction(GameAction.FORCED_UNDO);
action.setmoveStackIndex(index);
- gameUIManager.processOnServer(action);
+ gameUIManager.processAction(action);
}
}
Modified: trunk/18xx/rails/ui/swing/StartRoundWindow.java
===================================================================
--- trunk/18xx/rails/ui/swing/StartRoundWindow.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/StartRoundWindow.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -736,6 +736,6 @@
public void keyTyped(KeyEvent e) {}
public boolean process(PossibleAction action) {
- return gameUIManager.processOnServer(action);
+ return gameUIManager.processAction(action);
}
}
Modified: trunk/18xx/rails/ui/swing/StatusWindow.java
===================================================================
--- trunk/18xx/rails/ui/swing/StatusWindow.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/StatusWindow.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -433,7 +433,14 @@
if (!(currentRound instanceof StockRound || currentRound instanceof EndOfGameRound))
return;
- if (!myTurn) return;
+ passButton.setEnabled(false);
+ autopassButton.setEnabled(false);
+
+ log.debug ("MyTurn="+myTurn);
+ if (!myTurn) {
+ gameStatus.initTurn(getCurrentPlayer().getIndex(), false);
+ return;
+ }
// Moved here from StatusWindow_1856. It's getting generic...
if (possibleActions.contains(DiscardTrain.class)) {
@@ -447,14 +454,14 @@
setTitle(LocalText.getText(
"TRADE_TREASURY_SHARES_TITLE",
((TreasuryShareRound) currentRound).getOperatingCompany().getName()));
- gameStatus.initTurn(-1);
+ gameStatus.initTurn(-1, true);
passButton.setEnabled(true);
} else if ((currentRound instanceof ShareSellingRound)) {
setTitle(LocalText.getText(
"EMERGENCY_SHARE_SELLING_TITLE",
(((ShareSellingRound) currentRound).getCompanyNeedingCash().getName())));
- gameStatus.initTurn(gameUIManager.getCurrentPlayer().getIndex());
+ gameStatus.initTurn(getCurrentPlayer().getIndex(), true);
gameStatus.setPriorityPlayer(gameUIManager.getPriorityPlayer().getIndex());
passButton.setEnabled(false);
@@ -488,7 +495,7 @@
setTitle(LocalText.getText(
"STOCK_ROUND_TITLE",
String.valueOf(((StockRound) currentRound).getStockRoundNumber())));
- gameStatus.initTurn(gameUIManager.getCurrentPlayer().getIndex());
+ gameStatus.initTurn(getCurrentPlayer().getIndex(), true);
gameStatus.setPriorityPlayer(gameUIManager.getPriorityPlayer().getIndex());
passButton.setEnabled(true);
@@ -673,7 +680,7 @@
return false;
}
- return gameUIManager.processOnServer(executedAction);
+ return gameUIManager.processAction(executedAction);
}
public boolean processImmediateAction() {
@@ -727,7 +734,7 @@
public void finishRound() {
setTitle(LocalText.getText("GAME_STATUS_TITLE"));
- gameStatus.initTurn(-1);
+ gameStatus.initTurn(-1, true);
passButton.setEnabled(false);
}
Modified: trunk/18xx/rails/ui/swing/gamespecific/_18EU/StatusWindow_18EU.java
===================================================================
--- trunk/18xx/rails/ui/swing/gamespecific/_18EU/StatusWindow_18EU.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/ui/swing/gamespecific/_18EU/StatusWindow_18EU.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -32,7 +32,7 @@
if (currentRound instanceof FinalMinorExchangeRound) {
setTitle(LocalText.getText("FinalMinorExchangeRoundTitle"));
- gameStatus.initTurn(gameUIManager.getCurrentPlayer().getIndex());
+ gameStatus.initTurn(getCurrentPlayer().getIndex(), true);
return true;
}
return false;
Modified: trunk/18xx/rails/util/RunGame.java
===================================================================
--- trunk/18xx/rails/util/RunGame.java 2011-03-29 13:13:57 UTC (rev 1503)
+++ trunk/18xx/rails/util/RunGame.java 2011-03-30 14:57:13 UTC (rev 1504)
@@ -69,7 +69,7 @@
Class<? extends GameUIManager> gameUIManagerClass =
Class.forName(gameUIManagerClassName).asSubclass(GameUIManager.class);
gameUIManager = gameUIManagerClass.newInstance();
- gameUIManager.init(gameManager);
+ gameUIManager.init(gameManager, true);
String directory = new java.io.File(filepath).getParent();
if(directory != null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-29 13:14:06
|
Revision: 1503
http://rails.svn.sourceforge.net/rails/?rev=1503&view=rev
Author: evos
Date: 2011-03-29 13:13:57 +0000 (Tue, 29 Mar 2011)
Log Message:
-----------
Contribution by Bill Rosgen: Private purchasing rules are now all defined as PrivateCompany attributes with the new <Tradeable> tag. This includes the price factor limits, which were formerly defined with the (buying) major Company type.
The 1830 B&O private is now correctly excluded.
Modified Paths:
--------------
trunk/18xx/data/1830/CompanyManager.xml
trunk/18xx/data/1856/CompanyManager.xml
trunk/18xx/data/1870/CompanyManager.xml
trunk/18xx/data/1889/CompanyManager.xml
trunk/18xx/data/18AL/CompanyManager.xml
trunk/18xx/data/18Kaas/CompanyManager.xml
trunk/18xx/data/18VA/CompanyManager.xml
trunk/18xx/data/GamesList.xml
trunk/18xx/rails/game/OperatingRound.java
trunk/18xx/rails/game/PrivateCompany.java
trunk/18xx/rails/game/PrivateCompanyI.java
trunk/18xx/rails/game/PublicCompany.java
trunk/18xx/rails/game/PublicCompanyI.java
trunk/18xx/rails/util/Tag.java
Added Paths:
-----------
trunk/18xx/data/18GA/
trunk/18xx/data/18GA/CompanyManager.xml
trunk/18xx/data/18GA/Game.xml
trunk/18xx/data/18GA/Map.xml
trunk/18xx/data/18GA/StockMarket.xml
trunk/18xx/data/18GA/TileSet.xml
trunk/18xx/data/18GA/Tiles.xml
trunk/18xx/data/18JR/
trunk/18xx/data/18JR/CompanyManager.xml
trunk/18xx/data/18JR/Game.xml
trunk/18xx/data/18JR/Map.xml
trunk/18xx/data/18JR/StockMarket.xml
trunk/18xx/data/18JR/TileSet.xml
trunk/18xx/data/18JR/Tiles.xml
Modified: trunk/18xx/data/1830/CompanyManager.xml
===================================================================
--- trunk/18xx/data/1830/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502)
+++ trunk/18xx/data/1830/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -4,9 +4,11 @@
<ClosingConditions>
<Phase>5</Phase>
</ClosingConditions>
+ <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
+ <Tradeable toPlayer="yes"/>
</CompanyType>
<CompanyType name="Public" class="rails.game.PublicCompany">
- <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
+ <CanBuyPrivates/>
<PoolPaysOut/>
<Float percentage="60"/>
<ShareUnit percentage="10"/>
@@ -64,6 +66,7 @@
longname="Baltimore & Ohio">
<Info key="ComesWithPresidency" parm="B&O,20"/>
<Blocking hex="I13,I15"/>
+ <Tradeable toCompany="no"/>
</Company>
<!-- Note two supported colour specification formats:
Modified: trunk/18xx/data/1856/CompanyManager.xml
===================================================================
--- trunk/18xx/data/1856/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502)
+++ trunk/18xx/data/1856/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<CompanyManager>
<CompanyType name="Private" class="rails.game.PrivateCompany">
+ <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
</CompanyType>
<CompanyType name="Public" class="rails.game.specific._1856.PublicCompany_1856">
- <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
+ <CanBuyPrivates/>
<PoolPaysOut/>
<ShareUnit percentage="10"/>
<Certificate type="President" shares="2"/>
Modified: trunk/18xx/data/1870/CompanyManager.xml
===================================================================
--- trunk/18xx/data/1870/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502)
+++ trunk/18xx/data/1870/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -3,10 +3,11 @@
<CompanyManager>
<CompanyType name="Private" class="rails.game.PrivateCompany">
+ <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
</CompanyType>
<CompanyType name="Public" class="rails.game.PublicCompany">
- <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
+ <CanBuyPrivates/>
<IPOPaysOut/>
<Float percentage="60"/>
<CanSplitDividend/>
Modified: trunk/18xx/data/1889/CompanyManager.xml
===================================================================
--- trunk/18xx/data/1889/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502)
+++ trunk/18xx/data/1889/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -2,10 +2,11 @@
<CompanyManager>
<!-- Specific PrivateCompany to avoid closing of Uno-Takamatsu Ferry -->
<CompanyType name="Private" class="rails.game.PrivateCompany">
+ <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
</CompanyType>
<CompanyType name="Public" class="rails.game.PublicCompany">
<IfOption name="BeginnerGame" value="no">
- <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
+ <CanBuyPrivates/>
</IfOption>
<PoolPaysOut/>
<Float percentage="50"/>
Modified: trunk/18xx/data/18AL/CompanyManager.xml
===================================================================
--- trunk/18xx/data/18AL/CompanyManager.xml 2011-03-26 20:56:14 UTC (rev 1502)
+++ trunk/18xx/data/18AL/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<CompanyManager>
<CompanyType name="Private" class="rails.game.PrivateCompany">
+ <Tradeable toCompany="yes" lowerPriceFactor="0.5" upperPriceFactor="1.5"/>
</CompanyType>
<CompanyType name="Public" class="rails.game.PublicCompany">
- <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="1.5"/>
+ <CanBuyPrivates/>
<PoolPaysOut/>
<Float percentage="60"/>
<ShareUnit percentage="10"/>
Added: trunk/18xx/data/18GA/CompanyManager.xml
===================================================================
--- trunk/18xx/data/18GA/CompanyManager.xml (rev 0)
+++ trunk/18xx/data/18GA/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<CompanyManager>
+ <CompanyType name="Private" class="rails.game.PrivateCompany">
+ </CompanyType>
+ <CompanyType name="Public" class="rails.game.PublicCompany">
+ <PoolPaysOut/>
+ <Float percentage="60"/>
+ <ShareUnit percentage="10"/>
+ <Certificate type="President" shares="2"/>
+ <Certificate shares="1" number="8"/>
+ <BaseTokens>
+ <LayCost method="sequence" cost="0,40,100"/>
+ </BaseTokens>
+ <Trains number="4,4,3,2"/>
+ <CanUseSpecialProperties/>
+ </CompanyType>
+ <Company name="LTRR" type="Private" basePrice="20" revenue="5" longname="Lexington Terminal RR"/>
+ <Company name="MRC" type="Private" basePrice="40" revenue="10" longname="Midland Railroad Co."/>
+ <Company name="WSRR" type="Private" basePrice="70" revenue="15" longname="Waycross & Southern RR"/>
+ <Company name="OSRR" type="Private" basePrice="100" revenue="20" longname="Ocilla Southern RR"/>
+ <Company name="MBRR" type="Private" basePrice="150" revenue="25" longname="Macon & Birmingham RR"/>
+
+ <Company name="ACL" type="Public" tokens="4" fgColour="FFFFFF" bgColour="1F1A17" longname="Atlantic Coast Line">
+ <Home hex="J12" />
+ </Company>
+ <Company name="CoG" type="Public" tokens="4" fgColour="FFFFFF" bgColour="CC3366" longname="Central of Georgia">
+ <Home hex="F6" />
+ </Company>
+ <Company name="GR" type="Public" tokens="4" fgColour="FFFFFF" bgColour="219C29" longname="Georgia Railroad">
+ <Home hex="D10" />
+ </Company>
+ <Company name="G&F" type="Public" tokens="2" fgColour="000000" bgColour="75C4F0" longname="Georgia & Florida RR">
+ <Home hex="H4" />
+ </Company>
+ <Company name="SAL" type="Public" tokens="3" fgColour="000000" bgColour="F7C400" longname="Seaboard Air Line">
+ <Home hex="G13" />
+ </Company>
+ <Company name="W&AR" type="Public" tokens="2" fgColour="FFFFFF" bgColour="994778" longname="Western & Atlantic Railroad">
+ <Home hex="D4" />
+ </Company>
+ <StartPacket roundClass="rails.game.StartRound_1830">
+ <Bidding initial="5" minimum="5" increment="1" />
+ <Item name="LTRR" type="Private" basePrice="20" />
+ <Item name="MRC" type="Private" basePrice="40" />
+ <Item name="WSRR" type="Private" basePrice="70" />
+ <Item name="OSRR" type="Private" basePrice="100" />
+ <Item name="MBRR" type="Private" basePrice="150" />
+ </StartPacket>
+</CompanyManager>
\ No newline at end of file
Property changes on: trunk/18xx/data/18GA/CompanyManager.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18GA/Game.xml
===================================================================
--- trunk/18xx/data/18GA/Game.xml (rev 0)
+++ trunk/18xx/data/18GA/Game.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<ComponentManager>
+ <Component name="GameManager" class="rails.game.GameManager">
+ <Game name="18GA"/>
+ <GameParameters>
+ <PlayerShareLimit percentage="60"/>
+ <BankPoolLimit percentage="50"/>
+ <StockRound>
+ <NoSaleInFirstSR/>
+ </StockRound>
+ </GameParameters>
+ <GuiClasses>
+ </GuiClasses>
+ <EndOfGame>
+ <Bankruptcy/>
+ <BankBreaks limit="0" finish="currentOR"/>
+ <!-- "Runs out"; when "broken", -1 is the limit -->
+ <!-- Also when the share value reaches $300; this is configured in teh stock market XML -->
+ </EndOfGame>
+ </Component>
+ <Component name="PlayerManager" class="rails.game.PlayerManager">
+ <Players number="3" cash="600" certLimit="15"/>
+ <Players number="4" cash="450" certLimit="12"/>
+ <Players number="5" cash="360" certLimit="10"/>
+ </Component>
+ <Component name="Bank" class="rails.game.Bank">
+ <Bank amount="8000"/>
+ </Component>
+ <Component name="TileManager" class="rails.game.TileManager"
+ file="TileSet.xml"/>
+ <Component name="Map" class="rails.game.MapManager" file="Map.xml"/>
+ <Component name="CompanyManager" class="rails.game.CompanyManager"
+ file="CompanyManager.xml"/>
+ <Component name="StockMarket" class="rails.game.StockMarket"
+ file="StockMarket.xml"/>
+ <Component name="TrainManager" class="rails.game.TrainManager">
+ <Train name="2" majorStops="2" cost="100" amount="5"/>
+ <Train name="3" majorStops="3" cost="180" amount="4" startPhase="3"/>
+ <Train name="4" majorStops="4" cost="300" amount="3" startPhase="4"
+ rustedTrain="2" >
+ <IfOption name="Obsolete4Trains" value="yes">
+ <Attributes obsoleting="yes"/>
+ </IfOption>
+ <IfOption name="Obsolete4Trains" value="no">
+ <Attributes obsoleting="no"/>
+ </IfOption>
+ </Train>/>
+ <Train name="5" majorStops="5" cost="450" amount="2" startPhase="5"/>
+ <Train name="6" majorStops="6" cost="630" amount="2" startPhase="6"
+ rustedTrain="3"/>
+ <Train name="8" majorStops="8" cost="800" amount="5" startPhase="8"
+ rustedTrain="4"/>
+ </Component>
+ <Component name="PhaseManager" class="rails.game.PhaseManager">
+ <Phase name="2" >
+ <Tiles colour="yellow"/>
+ <OperatingRounds number="1"/>
+ <Trains tradingAllowed="yes"/>
+ </Phase>
+ <Phase name="3">
+ <Tiles colour="yellow,green"/>
+ <Privates sellingAllowed="yes"/>
+ <OperatingRounds number="2"/>
+ </Phase>
+ <Phase name="4">
+ <Tiles colour="yellow,green"/>
+ <Trains />
+ </Phase>
+ <Phase name="5">
+ <Tiles colour="yellow,green,brown"/>
+ <OperatingRounds number="3"/>
+ <Privates close="yes"/>
+ <OffBoardRevenue step="2"/>
+ </Phase>
+ <Phase name="6">
+ <Tiles colour="yellow,green,brown"/>
+ </Phase>
+ <Phase name="8">
+ <Tiles colour="yellow,green,brown,grey"/>
+ </Phase>
+ </Component>
+ <Component name="RevenueManager" class="rails.algorithms.RevenueManager">
+ </Component>
+</ComponentManager>
\ No newline at end of file
Property changes on: trunk/18xx/data/18GA/Game.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18GA/Map.xml
===================================================================
--- trunk/18xx/data/18GA/Map.xml (rev 0)
+++ trunk/18xx/data/18GA/Map.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,117 @@
+<Map mapClass="rails.ui.swing.hexmap.EWHexMap" tileOrientation="EW" letterOrientation="vertical" even="B">
+ <Hex name="A3" tile="-902" orientation="1" value="30,60" city="Chattanooga" />
+
+ <Hex name="B2" tile="0" cost="60">
+ <Symbols>
+ <Symbol name="mountain" where="tp2SideA" anchorX="center" anchorY="center" fromPhase="0" toPhase="0" />
+ </Symbols>
+ </Hex>
+ <Hex name="B4" tile="0" />
+ <Hex name="B6" tile="0" cost="60">
+ <Symbols>
+ <Symbol name="mountain" where="tp2SideA" anchorX="center" anchorY="center" fromPhase="0" toPhase="0" />
+ </Symbols>
+ </Hex>
+ <Hex name="B8" tile="0" cost="60">
+ <Symbols>
+ <Symbol name="mountain" where="tp2SideA" anchorX="center" anchorY="center" fromPhase="0" toPhase="0" />
+ </Symbols>
+ </Hex>
+ <Hex name="B10" tile="-902" orientation="2" value="30,40" city="Greeneville" />
+
+ <Hex name="C1" tile="0" cost="60">
+ <Symbols>
+ <Symbol name="mountain" where="tp2SideA" anchorX="center" anchorY="center" fromPhase="0" toPhase="0" />
+ </Symbols>
+ </Hex>
+ <Hex name="C3" tile="-3008" city="Rome" />
+ <Hex name="C5" tile="0" cost="20">
+ <River from="center" to="D4" />
+ </Hex>
+ <Hex name="C7" tile="0" />
+ <Hex name="C9" tile="0" />
+
+ <Hex name="D2" tile="0" />
+ <Hex name="D4" tile="-3008" city="Atlanta" />
+ <Hex name="D6" tile="0" />
+ <Hex name="D8" tile="0" />
+ <Hex name="D10" tile="-3008" city="Augusta" />
+
+ <Hex name="E1" tile="-1143" orientation="1" value="30,40" city="Montgomery" />
+ <Hex name="E3" tile="0" cost="40">
+ <River from="D4" to="F2" />
+ </Hex>
+ <Hex name="E5" tile="0" />
+ <Hex name="E7" tile="-1" cost="20" city="Milledgeville">
+ <River from="center" to="F8" />
+ </Hex>
+ <Hex name="E9" tile="0" />
+ <Hex name="E11" tile="0" />
+
+ <Hex name="F2" tile="0" cost="40">
+ <River from="E3" to="G3" />
+ </Hex>
+ <Hex name="F4" tile="0">
+ <Private name="MBRR" />
+ </Hex>
+ <Hex name="F6" tile="-3008" city="Macon" />
+ <Hex name="F8" tile="0" cost="20">
+ <River from="E7" to="G9" />
+ </Hex>
+ <Hex name="F10" tile="0" />
+ <Hex name="F12" tile="0" cost="40">
+ <Symbols>
+ <Symbol name="swamp" where="tpCenter" anchorX="center" anchorY="bottom" fromPhase="0" toPhase="0" />
+ </Symbols>
+ <Private name="MRC" />
+ </Hex>
+
+ <Hex name="G1" tile="0">
+ <River from="G3" to="H2" />
+ </Hex>
+ <Hex name="G3" tile="-3008" cost="40" city="Columbus">
+ <River from="F2" to="G1" />
+ </Hex>
+ <Hex name="G5" tile="0" />
+ <Hex name="G7" tile="0">
+ <Private name="OSR" />
+ </Hex>
+ <Hex name="G9" tile="0" cost="20">
+ <River from="F8" to="H10" />
+ </Hex>
+ <Hex name="G11" tile="-1" city="Statesboro" />
+ <Hex name="G13" tile="-3008" city="Savannah" />
+
+ <Hex name="H2" tile="0" cost="40">
+ <River from="G1" to="I3" />
+ </Hex>
+ <Hex name="H4" tile="-3008" city="Albany" />
+ <Hex name="H6" tile="0" />
+ <Hex name="H8" tile="0" />
+ <Hex name="H10" tile="0" cost="20">
+ <River from="G9" to="H12" />
+ </Hex>
+ <Hex name="H12" tile="0" cost="20">
+ <River from="H10" to="H14" />
+ </Hex>
+
+ <Hex name="I3" tile="0" cost="40">
+ <River from="H2" to="J4" />
+ </Hex>
+ <Hex name="I5" tile="0" />
+ <Hex name="I7" tile="-1" city="Valdosta" />
+ <Hex name="I9" tile="-3008" city="Waycross">
+ <Private name="WSRR" />
+ </Hex>
+ <Hex name="I11" tile="-3008" city="Brunswick" />
+
+ <Hex name="J4" tile="-1143" value="20,50" city="Tallahassee" />
+ <Hex name="J6" tile="0" />
+ <Hex name="J8" tile="0" />
+ <Hex name="J10" tile="0">
+ <Symbols>
+ <Symbol name="swamp" where="tpCenter" anchorX="center" anchorY="bottom" fromPhase="0" toPhase="0" />
+ </Symbols>
+ </Hex>
+ <Hex name="J12" tile="-912" orientation="3" value="30,60" city="Jacksonville" />
+</Map>
\ No newline at end of file
Property changes on: trunk/18xx/data/18GA/Map.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18GA/StockMarket.xml
===================================================================
--- trunk/18xx/data/18GA/StockMarket.xml (rev 0)
+++ trunk/18xx/data/18GA/StockMarket.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,104 @@
+<StockMarket type="rectangular">
+ <StockSpaceType name="yellow" colour="FFFF00">
+ <NoCertLimit />
+ </StockSpaceType>
+
+ <StockSpace name="A1" price="60" />
+ <StockSpace name="A2" price="55" />
+ <StockSpace name="A3" price="50" type="yellow" />
+ <StockSpace name="A4" price="45" type="yellow" />
+ <StockSpace name="A5" price="40" type="yellow" />
+ <StockSpace name="A6" price="35" type="yellow" />
+ <StockSpace name="A7" price="30" type="yellow" />
+
+ <StockSpace name="B1" price="70" />
+ <StockSpace name="B2" price="60" />
+ <StockSpace name="B3" price="55" />
+ <StockSpace name="B4" price="50" type="yellow" />
+ <StockSpace name="B5" price="45" type="yellow" />
+ <StockSpace name="B6" price="40" type="yellow" />
+ <StockSpace name="B7" price="35" type="yellow" />
+
+ <StockSpace name="C1" price="80" />
+ <StockSpace name="C2" price="70" />
+ <StockSpace name="C3" price="60" />
+ <StockSpace name="C4" price="55">
+ <StartSpace />
+ </StockSpace>
+ <StockSpace name="C5" price="50" type="yellow" />
+ <StockSpace name="C6" price="45" type="yellow" />
+ <StockSpace name="C7" price="40" type="yellow" />
+
+ <StockSpace name="D1" price="90" />
+ <StockSpace name="D2" price="80" />
+ <StockSpace name="D3" price="70">
+ <StartSpace />
+ </StockSpace>
+ <StockSpace name="D4" price="60" />
+ <StockSpace name="D5" price="55" />
+ <StockSpace name="D6" price="50" type="yellow" />
+ <StockSpace name="D7" price="45" type="yellow" />
+
+ <StockSpace name="E1" price="100" />
+ <StockSpace name="E2" price="90">
+ <StartSpace />
+ </StockSpace>
+ <StockSpace name="E3" price="80" />
+ <StockSpace name="E4" price="70" />
+ <StockSpace name="E5" price="60" />
+ <StockSpace name="E6" price="55" type="yellow" />
+ <StockSpace name="E7" price="50" type="yellow" />
+
+ <StockSpace name="F1" price="110">
+ <StartSpace />
+ </StockSpace>
+ <StockSpace name="F2" price="100" />
+ <StockSpace name="F3" price="90" />
+ <StockSpace name="F4" price="80" />
+ <StockSpace name="F5" price="70" />
+
+ <StockSpace name="G1" price="120" />
+ <StockSpace name="G2" price="110" />
+ <StockSpace name="G3" price="100" />
+ <StockSpace name="G4" price="90" />
+ <StockSpace name="G5" price="80" />
+
+ <StockSpace name="H1" price="135" />
+ <StockSpace name="H2" price="120" />
+ <StockSpace name="H3" price="110" />
+ <StockSpace name="H4" price="100" />
+ <StockSpace name="H5" price="90" />
+
+ <StockSpace name="I1" price="150" />
+ <StockSpace name="I2" price="135" />
+ <StockSpace name="I3" price="120" />
+ <StockSpace name="I4" price="110" />
+
+ <StockSpace name="J1" price="170" />
+ <StockSpace name="J2" price="150" />
+ <StockSpace name="J3" price="135" />
+ <StockSpace name="J4" price="120" />
+
+ <StockSpace name="K1" price="190" />
+ <StockSpace name="K2" price="170" />
+ <StockSpace name="K3" price="150" />
+ <StockSpace name="K4" price="135" />
+
+ <StockSpace name="L1" price="210" />
+ <StockSpace name="L2" price="190" />
+ <StockSpace name="L3" price="170" />
+
+ <StockSpace name="M1" price="230" />
+ <StockSpace name="M2" price="210" />
+ <StockSpace name="M3" price="100" />
+
+ <StockSpace name="N1" price="250" />
+ <StockSpace name="N2" price="230" />
+
+ <StockSpace name="O1" price="275" />
+ <StockSpace name="O2" price="250" />
+
+ <StockSpace name="P1" price="300">
+ <GameOver />
+ </StockSpace>
+</StockMarket>
Property changes on: trunk/18xx/data/18GA/StockMarket.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18GA/TileSet.xml
===================================================================
--- trunk/18xx/data/18GA/TileSet.xml (rev 0)
+++ trunk/18xx/data/18GA/TileSet.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,236 @@
+<TileManager tiles="Tiles.xml">
+ <!-- Preprinted Tiles-->
+
+ <!-- Empty space -->
+ <Tile id="0">
+ <Upgrade id="7,8,9" />
+ </Tile>
+
+ <!-- Dit -->
+ <Tile id="-1">
+ <Upgrade id="3,4,58" />
+ </Tile>
+
+ <!-- City -->
+ <Tile id="-3008">
+ <Upgrade id="5,6,57" />
+ </Tile>
+
+ <!-- Chattanooga (A3), Greeneville (B10) -->
+ <Tile id="-902" />
+
+ <!-- Montgomery (E1), Tallahassee (J4) -->
+ <Tile id="-1143" />
+
+ <!-- Jacksonville (J12) -->
+ <Tile id="-912" />
+
+ <!-- Atlanta (D4) -->
+ <Tile id="-4010">
+ <Upgrade id="4451" />
+ </Tile>
+
+ <!-- Yellow Tiles -->
+
+ <!-- Sharp-curve dit (10) -->
+ <Tile id="3" quantity="3" >
+ <Upgrade id="141,142,143" />
+ </Tile>
+
+ <!-- Straight dit (10) -->
+ <Tile id="4" quantity="3">
+ <Upgrade id="141,142" />
+ </Tile>
+
+ <!-- Sharp-curve city (20) -->
+ <Tile id="5" quantity="2">
+ <Upgrade id="14,15" hex="-D10,-G13" />
+ <Upgrade id="4453" hex="D10" />
+ <Upgrade id="4454" hex="G13" />
+ </Tile>
+
+ <!-- Gentle-curve city (20) -->
+ <Tile id="6" quantity="2">
+ <Upgrade id="14,15" hex="-D10,-G13" />
+ <Upgrade id="4453" hex="D10" />
+ <Upgrade id="4454" hex="G13" />
+ </Tile>
+
+ <!-- Sharp curve -->
+ <Tile id="7" quantity="5">
+ <Upgrade id="26,27,28,29" />
+ </Tile>
+
+ <!-- Gentle curve -->
+ <Tile id="8" quantity="11">
+ <Upgrade id="16,17,19,23,24,25,28,29" />
+ </Tile>
+
+ <!-- Straight track -->
+ <Tile id="9" quantity="10">
+ <Upgrade id="19,20,23,24,26,27" />
+ </Tile>
+
+ <!-- Straight city (20) -->
+ <Tile id="57" quantity="4">
+ <Upgrade id="14,15" hex="-D10,-G13" />
+ <Upgrade id="4453" hex="D10" />
+ <Upgrade id="4454" hex="G13" />
+ </Tile>
+
+ <!-- Gentle-curve dit (10) -->
+ <Tile id="58" quantity="3">
+ <Upgrade id="141,142,143" />
+ </Tile>
+
+ <!-- Three dead-end cities (30), exits NW,NE,S, "Atlanta" -->
+ <Tile id="4451" quantity="1">
+ <Upgrade id="4452" />
+ </Tile>
+
+ <!-- Green Tiles -->
+
+ <!-- X-shape city (30) -->
+ <Tile id="14" quantity="4">
+ <Upgrade id="63" hex="-F6,-I11" />
+ <Upgrade id="4457" hex="I11" />
+ <Upgrade id="4458" hex="F6" />
+ </Tile>
+
+ <!-- K-shape city (30) -->
+ <Tile id="15" quantity="4">
+ <Upgrade id="63" hex="-F6,-I11" />
+ <Upgrade id="4457" hex="I11" />
+ <Upgrade id="4458" hex="F6" />
+ </Tile>
+
+ <!-- Two tracks crossing, K shape -->
+ <Tile id="16" quantity="1">
+ <Upgrade id="43,70" />
+ </Tile>
+
+ <!-- Two tracks non-crossing, )( shape -->
+ <Tile id="17" quantity="1">
+ <Upgrade id="47" />
+ </Tile>
+
+ <!-- Two tracks crossing, crossbow shape -->
+ <Tile id="19" quantity="1">
+ <Upgrade id="45,46" />
+ </Tile>
+
+ <!-- Two tracks crossing, X shape -->
+ <Tile id="20" quantity="1">
+ <Upgrade id="44,47" />
+ </Tile>
+
+ <!-- Switch, straight and gentle-curve right -->
+ <Tile id="23" quantity="4">
+ <Upgrade id="41,43,45,47" />
+ </Tile>
+
+ <!-- Switch, straight and gentle-curve left -->
+ <Tile id="24" quantity="4">
+ <Upgrade id="42,43,46,47" />
+ </Tile>
+
+ <!-- Switch, two gentle curves -->
+ <Tile id="25" quantity="1">
+ <Upgrade id="40,45,46" />
+ </Tile>
+
+ <!-- Switch, straight and sharp-curve right -->
+ <Tile id="26" quantity="1">
+ <Upgrade id="42,44,45" />
+ </Tile>
+
+ <!-- Switch, straight and sharp-curve left -->
+ <Tile id="27" quantity="1">
+ <Upgrade id="41,44,46" />
+ </Tile>
+
+ <!-- Switch, sharp and gentle curves right -->
+ <Tile id="28" quantity="2">
+ <Upgrade id="39,43,70" />
+ </Tile>
+
+ <!-- Switch, sharp and gentle curves left -->
+ <Tile id="29" quantity="2">
+ <Upgrade id="39,43,70" />
+ </Tile>
+
+ <!-- Dit (10), exits N,NE,S -->
+ <Tile id="141" quantity="2" />
+
+ <!-- Dit (10), exits N,NW,S -->
+ <Tile id="142" quantity="2" />
+
+ <!-- Dit (10), exits N,NW,NE -->
+ <Tile id="143" quantity="2" />
+
+ <!-- Three straight cities (20), crossing, "Atlanta" -->
+ <Tile id="4452" quantity="1">
+ <Upgrade id="4455" />
+ </Tile>
+
+ <!-- K-shape city (30), "Augusta" -->
+ <Tile id="4453" quantity="1">
+ <Upgrade id="4456" />
+ </Tile>
+
+ <!-- City (30), exits N,NW,SW, "Savannah" -->
+ <Tile id="4454" quantity="1">
+ <Upgrade id="4459" />
+ </Tile>
+
+ <!-- Brown Tiles -->
+
+ <!-- "Delta" interchange, exits N,NE,SE -->
+ <Tile id="39" quantity="2" />
+
+ <!-- "Delta" interchange, exits NW,NE,S -->
+ <Tile id="40" quantity="1" />
+
+ <!-- "Delta" interchange, exits N,NE,S -->
+ <Tile id="41" quantity="3" />
+
+ <!-- "Delta" interchange, exits N,NW,S -->
+ <Tile id="42" quantity="3" />
+
+ <!-- Interchange, tracks N-S, NE-SE, N-SE, S-NE -->
+ <Tile id="43" quantity="2" />
+
+ <!-- Interchange, tracks N-S, NW-SE, N-NW, S-SE -->
+ <Tile id="44" quantity="1" />
+
+ <!-- Interchange, tracks N-S, NW-NE, N-NW, S-NE -->
+ <Tile id="45" quantity="2" />
+
+ <!-- Interchange, tracks N-S, NW-NE, N-NE, S-NW -->
+ <Tile id="46" quantity="2" />
+
+ <!-- Interchange, tracks N-S, NW-SE, N-SE, S-NW -->
+ <Tile id="47" quantity="2" />
+
+ <!-- 6-way city (40) -->
+ <Tile id="63" quantity="4" />
+
+ <!-- Interchange, tracks N-SE, S-NE, N-NE, S-SE -->
+ <Tile id="70" quantity="1" />
+
+ <!-- Three straight cities (70), crossing, "Atlanta" -->
+ <Tile id="4455" quantity="1" />
+
+ <!-- K-shape city (50), "Augusta" -->
+ <Tile id="4456" quantity="1" />
+
+ <!-- 5-way city (40), "Brunswick" -->
+ <Tile id="4457" quantity="1" />
+
+ <!-- 5-way city (50), "Macon" -->
+ <Tile id="4458" quantity="1" />
+
+ <!-- City (60), exits N,NW,SW, "Savannah" -->
+ <Tile id="4459" quantity="1" />
+
+</TileManager>
Property changes on: trunk/18xx/data/18GA/TileSet.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18GA/Tiles.xml
===================================================================
--- trunk/18xx/data/18GA/Tiles.xml (rev 0)
+++ trunk/18xx/data/18GA/Tiles.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Tiles>
+ <Tile colour="white" id="0" name="empty" />
+ <Tile colour="white" id="-1" name="1 village">
+ <Station id="city1" position="002" type="Town" />
+ </Tile>
+ <Tile colour="white" id="-10" name="1 city">
+ <Station id="city1" position="302" slots="1" type="City" />
+ </Tile>
+ <Tile colour="fixed" id="-111" name="Meridian">
+ <Station id="city1" position="0" slots="2" type="City" />
+ <Track from="city1" gauge="normal" to="side0" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="fixed" id="-112" name="Tupelo">
+ <Station id="city1" position="0" slots="1" type="City" value="30" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="fixed" id="-113" name="Oxmoor">
+ <Station id="city1" position="0" slots="1" type="City" value="30" />
+ <Track from="city1" gauge="normal" to="side5" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="fixed" id="-3" name="MF 3">
+ <Station id="city1" position="252" type="Town" value="10" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="red" id="-901" name="OM 1 way">
+ <Station id="city1" position="0" type="OffMapCity" value="-1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ </Tile>
+ <Tile colour="red" id="-902" name="OM 2 way">
+ <Station id="city1" position="0" type="OffMapCity" value="-1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side1" />
+ </Tile>
+ <Tile colour="red" id="-912" name="OMCity-2">
+ <Station id="city1" position="0" slots="1" type="OffMapCity" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ </Tile>
+ <Tile colour="red" id="-913" name="OMCity-3">
+ <Station id="city1" position="0" slots="1" type="OffMapCity" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="yellow" id="3" name="3">
+ <Station id="city1" position="352" type="Town" value="10" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side4" />
+ </Tile>
+ <Tile colour="yellow" id="4" name="4">
+ <Station id="city1" position="0" type="Town" value="10" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="yellow" id="5" name="5">
+ <Station id="city1" position="0" slots="1" type="City" value="20" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ </Tile>
+ <Tile colour="yellow" id="6" name="6">
+ <Station id="city1" position="0" slots="1" type="City" value="20" />
+ <Track from="city1" gauge="normal" to="side0" />
+ <Track from="city1" gauge="normal" to="side2" />
+ </Tile>
+ <Tile colour="yellow" id="7" name="7">
+ <Track from="side3" gauge="normal" to="side4" />
+ </Tile>
+ <Tile colour="yellow" id="8" name="8">
+ <Track from="side3" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="yellow" id="9" name="9">
+ <Track from="side3" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="yellow" id="57" name="57">
+ <Station id="city1" position="0" slots="1" type="City" value="20" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="yellow" id="58" name="58">
+ <Station id="city1" position="401" type="Town" value="10" />
+ <Track from="city1" gauge="normal" to="side5" />
+ <Track from="city1" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="yellow" id="1441" name="441">
+ <Station id="city1" position="0" slots="1" type="City" value="10" />
+ <Track from="city1" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="yellow" id="445" name="445">
+ <Station id="city1" position="0" type="Town" value="20" />
+ <Track from="city1" gauge="normal" to="side5" />
+ <Track from="city1" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="green" id="14" name="14">
+ <Station id="city1" position="0" slots="2" type="City" value="30" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side4" />
+ <Track from="city1" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="green" id="15" name="15">
+ <Station id="city1" position="0" slots="2" type="City" value="30" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side4" />
+ <Track from="city1" gauge="normal" to="side5" />
+ <Track from="city1" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="green" id="16" name="16">
+ <Track from="side3" gauge="normal" to="side5" />
+ <Track from="side4" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="green" id="17" name="17">
+ <Track from="side0" gauge="normal" to="side2" />
+ <Track from="side3" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="green" id="19" name="19">
+ <Track from="side5" gauge="normal" to="side1" />
+ <Track from="side0" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="green" id="20" name="20">
+ <Track from="side1" gauge="normal" to="side4" />
+ <Track from="side3" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="green" id="23" name="23">
+ <Track from="side4" gauge="normal" to="side0" />
+ <Track from="side0" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="green" id="24" name="24">
+ <Track from="side3" gauge="normal" to="side5" />
+ <Track from="side3" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="green" id="25" name="25">
+ <Track from="side1" gauge="normal" to="side3" />
+ <Track from="side3" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="green" id="26" name="26">
+ <Track from="side5" gauge="normal" to="side0" />
+ <Track from="side0" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="green" id="27" name="27">
+ <Track from="side3" gauge="normal" to="side4" />
+ <Track from="side3" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="green" id="28" name="28">
+ <Track from="side3" gauge="normal" to="side5" />
+ <Track from="side4" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="green" id="29" name="29">
+ <Track from="side3" gauge="normal" to="side4" />
+ <Track from="side3" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="green" id="141" name="141">
+ <Station id="city1" position="0" type="Town" value="10" />
+ <Track from="city1" gauge="normal" to="side0" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="green" id="142" name="142">
+ <Station id="city1" position="0" type="Town" value="10" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side4" />
+ <Track from="city1" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="green" id="143" name="143">
+ <Station id="city1" position="0" type="Town" value="10" />
+ <Track from="city1" gauge="normal" to="side0" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ </Tile>
+ <Tile colour="green" id="144" name="144">
+ <Station id="city1" position="0" type="Town" value="10" />
+ <Track from="city1" gauge="normal" to="side0" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side4" />
+ </Tile>
+ <Tile colour="green" id="1442" name="442">
+ <Station id="city1" position="0" slots="2" type="City" value="30" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side4" />
+ <Track from="city1" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="green" id="1443" name="443">
+ <Station id="city1" position="0" slots="2" type="City" value="40" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side4" />
+ <Track from="city1" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="green" id="-3008" name="-3008">
+ </Tile>
+ <Tile colour="green" id="-1143" name="-1143">
+ </Tile>
+ <Tile colour="brown" id="39" name="39">
+ <Track from="side3" gauge="normal" to="side4"/>
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side4" gauge="normal" to="side5"/>
+ </Tile>
+ <Tile colour="brown" id="40" name="40">
+ <Track from="side1" gauge="normal" to="side3" />
+ <Track from="side1" gauge="normal" to="side5" />
+ <Track from="side3" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="brown" id="41" name="41">
+ <Track from="side4" gauge="normal" to="side0" />
+ <Track from="side4" gauge="normal" to="side3" />
+ <Track from="side0" gauge="normal" to="side3" />
+ </Tile>
+ <Tile colour="brown" id="42" name="42">
+ <Track from="side3" gauge="normal" to="side5" />
+ <Track from="side3" gauge="normal" to="side0" />
+ <Track from="side5" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="brown" id="43" name="43">
+ <Track from="side3" gauge="normal" to="side5" />
+ <Track from="side3" gauge="normal" to="side0" />
+ <Track from="side4" gauge="normal" to="side5" />
+ <Track from="side4" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="brown" id="44" name="44">
+ <Track from="side3" gauge="normal" to="side0" />
+ <Track from="side1" gauge="normal" to="side0" />
+ <Track from="side3" gauge="normal" to="side4" />
+ <Track from="side1" gauge="normal" to="side4" />
+ </Tile>
+ <Tile colour="brown" id="45" name="45">
+ <Track from="side1" gauge="normal" to="side5" />
+ <Track from="side1" gauge="normal" to="side3" />
+ <Track from="side5" gauge="normal" to="side0" />
+ <Track from="side3" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="brown" id="46" name="46">
+ <Track from="side1" gauge="normal" to="side5" />
+ <Track from="side1" gauge="normal" to="side0" />
+ <Track from="side3" gauge="normal" to="side5" />
+ <Track from="side3" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="brown" id="47" name="47">
+ <Track from="side3" gauge="normal" to="side0" />
+ <Track from="side3" gauge="normal" to="side1" />
+ <Track from="side4" gauge="normal" to="side0" />
+ <Track from="side4" gauge="normal" to="side1" />
+ </Tile>
+ <Tile colour="brown" id="63" name="63">
+ <Station id="city1" position="0" slots="2" type="City" value="40" />
+ <Track from="city1" gauge="normal" to="side0" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side4" />
+ <Track from="city1" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="brown" id="70" name="70">
+ <Track from="side3" gauge="normal" to="side5" />
+ <Track from="side3" gauge="normal" to="side4" />
+ <Track from="side5" gauge="normal" to="side0" />
+ <Track from="side4" gauge="normal" to="side0" />
+ </Tile>
+ <Tile colour="brown" id="1444" name="444">
+ <Station id="city1" position="0" slots="2" type="City" value="50" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side4" />
+ <Track from="city1" gauge="normal" to="side5" />
+ </Tile>
+ <Tile colour="gray" id="446" name="446">
+ <Station id="city1" position="0" slots="3" type="City" value="70" />
+ <Track from="city1" gauge="normal" to="side0" />
+ <Track from="city1" gauge="normal" to="side1" />
+ <Track from="city1" gauge="normal" to="side2" />
+ <Track from="city1" gauge="normal" to="side3" />
+ <Track from="city1" gauge="normal" to="side4" />
+ <Track from="city1" gauge="normal" to="side5" />
+ </Tile>
+</Tiles>
Property changes on: trunk/18xx/data/18GA/Tiles.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18JR/CompanyManager.xml
===================================================================
--- trunk/18xx/data/18JR/CompanyManager.xml (rev 0)
+++ trunk/18xx/data/18JR/CompanyManager.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<CompanyManager>
+ <CompanyType name="Private" class="rails.game.PrivateCompany">
+ <ClosingConditions>
+ <Phase>5</Phase>
+ </ClosingConditions>
+ </CompanyType>
+ <CompanyType name="Public" class="rails.game.PublicCompany">
+ <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
+ <PoolPaysOut/>
+ <Float percentage="60"/>
+ <ShareUnit percentage="10"/>
+ <BaseTokens>
+ <!-- HomeBase lay options: "whenStarted", "whenFloated", "firstOR" (default) -->
+ <HomeBase lay="firstOR"/>
+ <!-- LayCost methods: only "sequence" (1830 style) implemented so far (default) -->
+ <LayCost method="sequence" cost="0,40,100"/>
+ </BaseTokens>
+ <Certificate type="President" shares="2"/>
+ <Certificate shares="1" number="8"/>
+ <Trains number="4,4,3,2"/>
+ <CanUseSpecialProperties/>
+ </CompanyType>
+ <Company name="SVNRR" type="Private" basePrice="20" revenue="5"
+ longname="Schuylkill Valley Navigation & Railroad Company">
+ </Company>
+ <Company name="C&StL" type="Private" basePrice="40" revenue="10"
+ longname="Champlain & St.Lawrence">
+ </Company>
+ <Company name="D&H" type="Private" basePrice="70" revenue="15"
+ longname="Delaware & Hudson">
+ </Company>
+ <Company name="M&H" type="Private" basePrice="110" revenue="20"
+ longname="Mohawk & Hudson">
+ <SpecialProperties>
+ <SpecialProperty condition="ifOwnedByPlayer" when="anyTurn" class="rails.game.special.ExchangeForShare">
+ <ExchangeForShare company="NYC" share="10"/>
+ </SpecialProperty>
+ </SpecialProperties>
+ </Company>
+ <Company name="C&A" type="Private" basePrice="160" revenue="25"
+ longname="Camden & Amboy">
+ <Info key="ComesWithCertificate" parm="PRR,10"/>
+ </Company>
+ <Company name="B&O" type="Private" basePrice="220" revenue="30"
+ longname="Baltimore & Ohio">
+ <Info key="ComesWithPresidency" parm="B&O,20"/>
+ </Company>
+
+ <!-- Note two supported colour specification formats:
+ RGB decimal with commas and RGB hexadecimal without commas -->
+ <Company name="B&O" type="Public" tokens="2" fgColour="FFFFFF" bgColour="0,0,255"
+ longname="Baltimore and Ohio">
+ <Home hex="H6"/>
+ </Company>
+ <Company name="C&A" type="Public" tokens="2" fgColour="000000" bgColour="FF8000"
+ longname="Camden and Amboy">
+ <Home hex="E11"/>
+ </Company>
+ <Company name="C&O" type="Public" tokens="2" fgColour="000000" bgColour="A0E0FF"
+ longname="Chesapeake and Ohio Railway">
+ <Home hex="M7"/>
+ </Company>
+ <Company name="N&W" type="Public" tokens="2" fgColour="FFFFFF" bgColour="B03B00"
+ longname="Norfolk and Western">
+ <Home hex="M3"/>
+ </Company>
+ <Company name="PLE" type="Public" tokens="2" fgColour="FFFFFF" bgColour="000000"
+ longname="Pittsburgh and Lake Erie Railroad">
+ <Home hex="C1"/>
+ </Company>
+ <Company name="PRR" type="Public" tokens="2" fgColour="FFFFFF" bgColour="008000"
+ longname="Pennsylvania Railroad">
+ <Home hex="D10"/>
+ </Company>
+ <Company name="SQ" type="Public" tokens="2" fgColour="000000" bgColour="FFFF00"
+ longname="New York, Susquehanna and Western Railway">
+ <Home hex="B6"/>
+ </Company> <Company name="SRC" type="Public" tokens="2" fgColour="FFFF00" bgColour="FF0000"
+ longname="Strasburg Rail Road">
+ <FirstTrainCloses type="Private" name="B&O"/>
+ <Home hex="D8"/>
+ </Company>
+ <IfOption name="Variant" value="Pere Marquette">
+ <Company name="PM" type="Public" tokens="2" fgColour="FFFF00" bgColour="000080"
+ longname="Pere Marquette">
+ <Home hex="C7"/>
+ </Company>
+ </IfOption>
+ <StartPacket roundClass="rails.game.StartRound_1830">
+ <Bidding initial="5" minimum="5" increment="1"/>
+ <Item name="SVNRR" type="Private" basePrice="20"/>
+ <Item name="C&StL" type="Private" basePrice="40"/>
+ <Item name="D&H" type="Private" basePrice="70"/>
+ <Item name="M&H" type="Private" basePrice="110"/>
+ <Item name="C&A" type="Private" basePrice="160"/>
+ <Item name="B&O" type="Private" basePrice="220">
+ <SubItem name="B&O" type="Public" president="yes"/>
+ </Item>
+ </StartPacket>
+</CompanyManager>
Property changes on: trunk/18xx/data/18JR/CompanyManager.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18JR/Game.xml
===================================================================
--- trunk/18xx/data/18JR/Game.xml (rev 0)
+++ trunk/18xx/data/18JR/Game.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<ComponentManager>
+ <Component name="GameManager" class="rails.game.GameManager">
+ <Game name="18JR"/>
+ <!-- GAME OPTIONS must have:
+ - a name, which must also exist as an entry in LocalText.properties,
+ - optionally 'type="toggle"', which has the effect that the
+ selection uses a checkbox instead of a dropdown list.
+ In this case, 'values' must be absent
+ (the allowed values are fixed to "yes,no").
+ - optionally, 'values="a,b,c"' i,e, a list of allowed values.
+ - optionally, a default value (only affects a toggle;
+ in a dropdown the first item is always the default).
+ -->
+ <!-- The options in Game.xml are not currently used.
+ See GamesList.xml for the real ones.
+ -->
+ <GameOption name="Variant" values="Basegame,Cotton Port" default="Basegame" />
+ <GameOption name="NoMapMode" type="toggle" default="no" />
+ <GameOption name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" />
+ <GameOption name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" />
+ <GameOption name="BeginnerGame" type="toggle" default="no" />
+ <GameOption name="WithOptional6Train" type="toggle" default="no"/>
+ <GameOption name="UnlimitedTopTrains" parm="D" type="toggle" default="no"/>
+ <GameOption name="UnlimitedTiles" type="toggle" default="no"/>
+ <GameOption name="LeaveAuctionOnPass" type="toggle" default="no"/>
+ <GameOption name="TwoPlayersCertLimit70Percent" type="toggle" default="yes"/>
+ <GameOption name="SeparateSalesAtSamePrice" type="toggle" default="yes"/>
+ <GameParameters>
+ <PlayerShareLimit percentage="60">
+ <!-- Option "NumberOfPlayers" is automatically set
+ by the game engine -->
+ <IfOption name="NumberOfPlayers" value="2">
+ <IfOption name="TwoPlayersCertLimit70Percent" value="yes">
+ <Attributes percentage="70"/>
+ </IfOption>
+ </IfOption>
+ </PlayerShareLimit>
+ <BankPoolLimit percentage="50"/>
+ <StockRound>
+ <NoSaleInFirstSR/>
+ </StockRound>
+ </GameParameters>
+ <EndOfGame>
+ <Bankruptcy/>
+ <BankBreaks limit="0" finish="setOfORs"/>
+ <!-- "Runs out"; when "broken", -1 is the limit -->
+ </EndOfGame>
+ </Component>
+ <Component name="PlayerManager" class="rails.game.PlayerManager">
+ <IfOption name="Variant" value="Basegame">
+ <Players number="2" cash="1200" certLimit="28"/>
+ <Players number="3" cash="800" certLimit="20"/>
+ <Players number="4" cash="600" certLimit="16"/>
+ <Players number="5" cash="480" certLimit="13"/>
+ <Players number="6" cash="400" certLimit="11"/>
+ </IfOption>
+ <IfOption name="Variant" value="Pere Marquette">
+ <Players number="2" cash="1200" certLimit="32"/>
+ <Players number="3" cash="800" certLimit="22"/>
+ <Players number="4" cash="600" certLimit="17"/>
+ <Players number="5" cash="480" certLimit="14"/>
+ <Players number="6" cash="400" certLimit="12"/>
+ <Players number="7" cash="360" certLimit="11"/>
+ </IfOption>
+ </Component>
+ <Component name="Bank" class="rails.game.Bank">
+ <Bank amount="12000"/>
+ <Money format="$@"/>
+ </Component>
+ <Component name="TileManager" class="rails.game.TileManager"
+ file="TileSet.xml"/>
+ <Component name="Map" class="rails.game.MapManager" file="Map.xml"/>
+ <Component name="CompanyManager" class="rails.game.CompanyManager"
+ file="CompanyManager.xml"/>
+ <Component name="StockMarket" class="rails.game.StockMarket"
+ file="StockMarket.xml"/>
+ <Component name="TrainManager" class="rails.game.TrainManager">
+ <Defaults>
+ <Reach base="stops" countTowns="yes"/>
+ <!-- Alternative values:
+ base="hexes" for H-trains as in 1826, 1849 etc.
+ countTowns="no" for all trains in 1841, 18EU, etc.,
+ where towns score but do not count against the train length.
+ Otherwise, towns are counted as minor or major stops,
+ depending on the presence or absence of a "minorStops" value.
+ -->
+ <Score towns="yes"/>
+ <!-- Alternative values:
+ towns="no" for trains that ignore towns (e.g. 1826 TGV).
+ cities="double" if city-revenue is doubled (e.g. 1826 TGV).
+ -->
+ </Defaults>
+ <Train name="2" majorStops="2" cost="80" amount="6"/>
+ <Train name="3" majorStops="3" cost="180" amount="5" startPhase="3"/>
+ <Train name="4" majorStops="4" cost="300" amount="4" startPhase="4"
+ rustedTrain="2"/>
+ <Train name="5" majorStops="5" cost="450" amount="3" startPhase="5"/>
+ <!--Train name="6" majorStops="6" cost="630" amount="2" startPhase="6"
+ rustedTrain="3" releasedTrain="D"/-->
+ <Train name="6" majorStops="6" cost="630" startPhase="6"
+ rustedTrain="3" releasedTrain="D">
+ <IfOption name="WithOptional6Train" value="yes">
+ <Attributes amount="3"/>
+ </IfOption>
+ <IfOption name="WithOptional6Train" value="no">
+ <Attributes amount="2"/>
+ </IfOption>
+ <IfOption name="Variant" value="Pere Marquette">
+ <Attributes amount="3"/>
+ </IfOption>
+ </Train>
+ <Train name="D" majorStops="99" cost="1100" startPhase="D"
+ rustedTrain="4">
+ <IfOption name="UnlimitedTopTrains" value="yes">
+ <Attributes amount="-1"/>
+ </IfOption>
+ <IfOption name="UnlimitedTopTrains" value="no">
+ <Attributes amount="6"/>
+ </IfOption>
+ <Exchange cost="800"/>
+ </Train>
+ </Component>
+ <Component name="PhaseManager" class="rails.game.PhaseManager">
+ <!-- Note: released and rusted trains are now specified per Train
+ but could as well be moved here. To be sorted out when we do 18US. -->
+ <!-- Each Phase's defaults are the previous one's values -->
+ <Phase name="2" >
+ <Tiles colour="yellow"/>
+ <Privates sellingAllowed="no"/>
+ <OperatingRounds number="1"/>
+ <Trains tradingAllowed="yes"/>
+ </Phase>
+ <Phase name="3">
+ <Tiles colour="yellow,green"/>
+ <Privates sellingAllowed="yes"/>
+ <OperatingRounds number="2"/>
+ </Phase>
+ <Phase name="4">
+ <Tiles colour="yellow,green"/>
+ </Phase>
+ <Phase name="5">
+ <Tiles colour="yellow,green,brown"/>
+ <!--Privates close="yes"/-->
+ <OperatingRounds number="3"/>
+ <OffBoardRevenue step="2"/>
+ </Phase>
+ <Phase name="6">
+ <Tiles colour="yellow,green,brown"/>
+ </Phase>
+ <Phase name="D">
+ <Tiles colour="yellow,green,brown"/>
+ </Phase>
+ </Component>
+</ComponentManager>
\ No newline at end of file
Property changes on: trunk/18xx/data/18JR/Game.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18JR/Map.xml
===================================================================
--- trunk/18xx/data/18JR/Map.xml (rev 0)
+++ trunk/18xx/data/18JR/Map.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,65 @@
+<Map mapClass="rails.ui.swing.hexmap.NSHexMap" tileOrientation="NS" letterOrientation="vertical" even="B">
+
+ <Hex name="A5" tile="-7" orientation="1"/>
+ <Hex name="A7" tile="-7" orientation="2"/>
+ <Hex name="B2" tile="-902" orientation="1" value="40,50"/>
+ <Hex name="B4" tile="0" cost="120"/>
+ <Hex name="B6" tile="-10"/>
+ <Hex name="B8" tile="0"/>
+ <Hex name="B10" tile="0"/>
+ <Hex name="B12" tile="-902" orientation="2" value="40,50"/>
+ <Hex name="C1" tile="-104"/>
+ <Hex name="C3" tile="-10"/>
+ <Hex name="C5" tile="-10" cost="120"/>
+ <Hex name="C7" tile="-1" cost="40"/>
+ <Hex name="C9" tile="-1"/>
+ <Hex name="C11" tile="-2"/>
+ <Hex name="D2" tile="-2"/>
+ <Hex name="D4" tile="0" cost="120"/>
+ <Hex name="D6" tile="0"/>
+ <Hex name="D8" tile="-10" cost="40"/>
+ <Hex name="D10" tile="-10" cost="40"/>
+ <Hex name="D12" tile="0"/>
+ <Hex name="E3" tile="0"/>
+ <Hex name="E5" tile="0" cost="120"/>
+ <Hex name="E7" tile="0"/>
+ <Hex name="E9" tile="0" cost="40"/>
+ <Hex name="E11" tile="-10"/>
+ <Hex name="F2" tile="0"/>
+ <Hex name="F4" tile="0" cost="120"/>
+ <Hex name="F6" tile="0"/>
+ <Hex name="F8" tile="-10" cost="40"/>
+ <Hex name="F10" tile="0" cost="40"/>
+ <Hex name="G1" tile="-902" value="40,50"/>
+ <Hex name="G3" tile="-10"/>
+ <Hex name="G5" tile="0" cost="120"/>
+ <Hex name="G7" tile="0"/>
+ <Hex name="G9" tile="-10"/>
+ <Hex name="H2" tile="0"/>
+ <Hex name="H4" tile="0" cost="120"/>
+ <Hex name="H6" tile="-10"/>
+ <Hex name="H10" tile="0"/>
+ <Hex name="I3" tile="0"/>
+ <Hex name="I5" tile="-1"/>
+ <Hex name="I7" tile="0" cost="40"/>
+ <Hex name="I9" tile="0"/>
+ <Hex name="I11" tile="-901" orientation="3" value="40,50"/>
+ <Hex name="J2" tile="0"/>
+ <Hex name="J4" tile="0" cost="120"/>
+ <Hex name="J6" tile="0" cost="40"/>
+ <Hex name="J10" tile="0"/>
+ <Hex name="K3" tile="0"/>
+ <Hex name="K5" tile="-1"/>
+ <Hex name="K7" tile="0" cost="40"/>
+ <Hex name="K11" tile="-901" orientation="3" value="40,50"/>
+ <Hex name="L2" tile="0"/>
+ <Hex name="L4" tile="-10"/>
+ <Hex name="L6" tile="0"/>
+ <Hex name="L8" tile="0" cost="40"/>
+ <Hex name="M1" tile="-901" orientation="5" value="40,50"/>
+ <Hex name="M3" tile="-10" cost="120"/>
+ <Hex name="M5" tile="0"/>
+ <Hex name="M7" tile="-10"/>
+ <Hex name="N2" tile="-902" orientation="5" value="40,50"/>
+ <Hex name="N8" tile="-901" orientation="3" value="40,50"/>
+</Map>
Property changes on: trunk/18xx/data/18JR/Map.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18JR/StockMarket.xml
===================================================================
--- trunk/18xx/data/18JR/StockMarket.xml (rev 0)
+++ trunk/18xx/data/18JR/StockMarket.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,111 @@
+<StockMarket type="rectangular">
+ <!-- Note two supported colour specification formats:
+ RGB decimal with commas and RGB hexadecimal without commas -->
+ <StockSpaceType name="yellow" colour="255,255,0">
+ <NoCertLimit/>
+ </StockSpaceType>
+
+ <StockSpace name="A1" price="70" />
+ <StockSpace name="A2" price="65" type="yellow"/>
+ <StockSpace name="A3" price="55" type="yellow"/>
+ <StockSpace name="A4" price="50" type="yellow"/>
+ <StockSpace name="A5" price="45" type="yellow"/>
+ <StockSpace name="A6" price="40" type="yellow"/>
+ <StockSpace name="A7" price="30" type="yellow"/>
+ <StockSpace name="A8" price="20" type="yellow"/>
+ <StockSpace name="B1" price="75" />
+ <StockSpace name="B2" price="70" />
+ <StockSpace name="B3" price="65" type="yellow"/>
+ <StockSpace name="B4" price="60" type="yellow"/>
+ <StockSpace name="B5" price="55" type="yellow"/>
+ <StockSpace name="B6" price="50" type="yellow"/>
+ <StockSpace name="B7" price="40" type="yellow"/>
+ <StockSpace name="B8" price="30" type="yellow"/>
+ <StockSpace name="C1" price="80" />
+ <StockSpace name="C2" price="75" />
+ <StockSpace name="C3" price="70" />
+ <StockSpace name="C4" price="65" type="yellow"/>
+ <StockSpace name="C5" price="60" type="yellow"/>
+ <StockSpace name="C6" price="55" type="yellow"/>
+ <StockSpace name="C7" price="50" type="yellow"/>
+ <StockSpace name="C8" price="40" type="yellow"/>
+ <StockSpace name="D1" price="85" />
+ <StockSpace name="D2" price="80" />
+ <StockSpace name="D3" price="75" />
+ <StockSpace name="D4" price="70" />
+ <StockSpace name="D5" price="65" />
+ <StockSpace name="D6" price="60" type="yellow"/>
+ <StockSpace name="D7" price="55" type="yellow"/>
+ <StockSpace name="D8" price="45" type="yellow"/>
+ <StockSpace name="E1" price="90" />
+ <StockSpace name="E2" price="85" />
+ <StockSpace name="E3" price="80" />
+ <StockSpace name="E4" price="75" />
+ <StockSpace name="E5" price="70" />
+ <StockSpace name="E6" price="65" />
+ <StockSpace name="E7" price="60" />
+ <StockSpace name="E8" price="50" type="yellow"/>
+ <StockSpace name="F1" price="100" >
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="F2" price="90" >
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="F3" price="85" >
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="F4" price="80" >
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="F5" price="75" >
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="F6" price="70" >
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="F7" price="65" />
+ <StockSpace name="F8" price="60" />
+ <StockSpace name="G1" price="110" />
+ <StockSpace name="G2" price="100" />
+ <StockSpace name="G3" price="95" />
+ <StockSpace name="G4" price="85" />
+ <StockSpace name="G5" price="80" />
+ <StockSpace name="G6" price="75" />
+ <StockSpace name="G7" price="70" />
+ <StockSpace name="G8" price="65" />
+ <StockSpace name="H1" price="125" />
+ <StockSpace name="H2" price="110" />
+ <StockSpace name="H3" price="105" />
+ <StockSpace name="H4" price="95" />
+ <StockSpace name="H5" price="85" />
+ <StockSpace name="H6" price="80" />
+ <StockSpace name="H7" price="75" />
+ <StockSpace name="I1" price="140" />
+ <StockSpace name="I2" price="125" />
+ <StockSpace name="I3" price="115" />
+ <StockSpace name="I4" price="105" />
+ <StockSpace name="I5" price="95" />
+ <StockSpace name="I6" price="85" />
+ <StockSpace name="J1" price="160" />
+ <StockSpace name="J2" price="140" />
+ <StockSpace name="J3" price="130" />
+ <StockSpace name="J4" price="115" />
+ <StockSpace name="J5" price="105" />
+ <StockSpace name="K1" price="180" />
+ <StockSpace name="K2" price="160" />
+ <StockSpace name="K3" price="145" />
+ <StockSpace name="K4" price="130" />
+ <StockSpace name="L1" price="205" />
+ <StockSpace name="L2" price="180" />
+ <StockSpace name="L3" price="160" />
+ <StockSpace name="L4" price="145" />
+ <StockSpace name="M1" price="235" />
+ <StockSpace name="M2" price="205" />
+ <StockSpace name="M3" price="180" />
+ <StockSpace name="N1" price="265" />
+ <StockSpace name="N2" price="235" />
+ <StockSpace name="N3" price="205" />
+ <StockSpace name="O1" price="300" />
+ <StockSpace name="O2" price="265" />
+ <StockSpace name="O3" price="235" />
+</StockMarket>
Property changes on: trunk/18xx/data/18JR/StockMarket.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18JR/TileSet.xml
===================================================================
--- trunk/18xx/data/18JR/TileSet.xml (rev 0)
+++ trunk/18xx/data/18JR/TileSet.xml 2011-03-29 13:13:57 UTC (rev 1503)
@@ -0,0 +1,128 @@
+<TileManager tiles="Tiles.xml">
+ <!-- Preprinted tiles -->
+ <Tile id="0"><!-- Empty space -->
+ <Upgrade id="7,8,9"/>
+ </Tile>
+ <Tile id="-1"><!-- 1 town -->
+ <Upgrade id="3,4,58"/>
+ </Tile>
+ <Tile id="-2"><!-- 2 towns -->
+ <Upgrade id="1,2,55,56,69"/>
+ </Tile>
+ <Tile id="-3"/>
+ <Tile id="-5"/>
+ <Tile id="-7"/>
+ <Tile id="-10"><!-- 1 city -->
+ <Upgrade id="57,1441"/>
+ </Tile>
+ <Tile id="-11"><!-- B yellow -->
+ <Upgrade id="53"/>
+ </Tile>
+ <Tile id="-20"><!-- 2 OO cities -->
+ <Upgrade id="59" relayBaseTokens="yes"/>
+ </Tile>
+ <Tile id="-21"><!-- New York -->
+ <Upgrade id="54"/>
+ </Tile>
+ <Tile id="-58"/>
+ <Tile id="-101"/><!-- Altoona -->
+ <Tile id="-102"/><!-- Rochester -->
+ <Tile id="-103"/><!-- Montreal -->
+ <Tile id="-104"/><!-- Norwich -->
+ <Tile id="-105"/><!-- Cleveland -->
+ <Tile id="-901"/>
+ <Tile id="-902"/>
+ <Tile id="-903"/>
+
+ <!-- Yellow tiles -->
+ <Tile id="1" quantity="1" />
+ <Tile id="2" quantity="1" />
+ <Tile id="3" quantity="2" />
+ <Tile id="4" quantity="2" />
+ <Tile id="7" quantity="4">
+ <Upgrade id="18,26,27,28,29" />
+ </Tile>
+ <Tile id="8" quantity="8">
+ <Upgrade id="16,19,23,24,25,28,29" />
+ </Tile>
+ <Tile id="9" quantity="7">
+ <Upgrade id="18,19,20,23,24,26,27" />
+ </Tile>
+ <Tile id="55" quantity="1" />
+ <Tile id="56" quantity="1" />
+ <Tile id="57" quantity="4">
+ <Upgrade id="14,15" />
+ </Tile>
+ <Tile id="58" quantity="2" />
+ <Tile id="69" quantity="1" />
+
+ <!-- Green tiles -->
+ <Tile id="14" quantity="3">
+ <Upgrade id="63" />
+ </Tile>
+ <Tile id="15" quantity="2">
+ <Upgrade id="63" />
+ </Tile>
+ <Tile id="16" quantity="1">
+ <Upgrade id="43,70" />
+ </Tile>
+ <Tile id="18" quantity="1">
+ <Upgrade id="43" />
+ </Tile>
+ <Tile id="19" quantity="1">
+ <Upgrade id="45,46" />
+ </Tile>
+ <Tile id="20" quantity="1">
+ <Upgrade id="44,47" />
+ </Tile>
+ <Tile id="23" quantity="3">
+ <Upgrade id="41,43,45,47" />
+ </Tile>
+ <Tile id="24" quantity="3">
+ <Upgrade id="42,43,46,47" />
+ </Tile>
+ <Tile id="25" quantity="1">
+ <Upgrade id="40,45,46" />
+ </Tile>
+ <Tile id="26" quantity="1">
+ <Upgrade id="42,44,45" />
+ </Tile>
+ <Tile id="27" quantity="1">
+ <Upgrade id="41,44,46" />
+ </Tile>
+ <Tile id="28" quantity="1">
+ <Upgrade id="39,43,46,70" />
+ </Tile>
+ <Tile id="29" quantity="1">
+ <Upgrade id="39,43,45,70" />
+ </Tile>
+ <Tile id="53" quantity="2">
+ <Upgrade id="61" />
+ </Tile>
+ <Tile id="54" quantity="1">
+ <Upgrade id="62" />
+ </Tile>
+ <Tile id="59" quantity="2">
+ <Upgrade id="64,65,66,67,68" />
+ </Tile>
+ <!-- Brown tiles -->
+ <Tile id="39" quantity="1" />
+ <Tile id="40" quantity="1" />
+ <Tile id="41" quantity="2" />
+ <Tile id="42" quantity="2" />
+ <Tile id="43" quantity="2" />
+ <Tile id="44" quantity="1" />
+ <Tile id="45" quantity="2" />
+ <Tile id="46" quantity="2" />
+ <Tile id="47" quantity="1" />
+ <Tile id="61" quantity="2" />
+ <Tile id="62" quantity="1" />
+ <Tile id="63" quantity="3" />
+ <Tile id="64" quantity="1" />
+ <Tile id="65" quantity="1" />
+ <Tile id="66" quantity="1" />
+ <Tile id="67" quantity="1" />
+ <Tile id="68" quantit...
[truncated message content] |
|
From: <ev...@us...> - 2011-03-26 20:56:20
|
Revision: 1502
http://rails.svn.sourceforge.net/rails/?rev=1502&view=rev
Author: evos
Date: 2011-03-26 20:56:14 +0000 (Sat, 26 Mar 2011)
Log Message:
-----------
Autosave/load, added popup
Modified Paths:
--------------
trunk/18xx/LocalisedText.properties
trunk/18xx/rails/ui/swing/GameUIManager.java
Modified: trunk/18xx/LocalisedText.properties
===================================================================
--- trunk/18xx/LocalisedText.properties 2011-03-26 20:42:51 UTC (rev 1501)
+++ trunk/18xx/LocalisedText.properties 2011-03-26 20:56:14 UTC (rev 1502)
@@ -696,4 +696,5 @@
YouMustRaiseCash=You must raise {0} cash by selling shares
YouMustRaiseCashButCannot=You must still raise {0}, but you can''t sell any more shares.
YouMustSelect1=You must select {0} item(s)
-YouMustSelect2=You must select between {0} and {1} items
\ No newline at end of file
+YouMustSelect2=You must select between {0} and {1} items
+YourTurn={0}, it''s your turn again
\ No newline at end of file
Modified: trunk/18xx/rails/ui/swing/GameUIManager.java
===================================================================
--- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-26 20:42:51 UTC (rev 1501)
+++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-26 20:56:14 UTC (rev 1502)
@@ -268,7 +268,11 @@
} else if (!wasMyTurn && myTurn) {
log.info ("Resuming turn as "+saveSuffix);
autoLoadPoller.setActive(false);
- }
+ setCurrentDialog(new MessageDialog(this,
+ LocalText.getText("Message"),
+ LocalText.getText("YourTurn", saveSuffix)),
+ null);
+ }
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-26 20:42:59
|
Revision: 1501
http://rails.svn.sourceforge.net/rails/?rev=1501&view=rev
Author: evos
Date: 2011-03-26 20:42:51 +0000 (Sat, 26 Mar 2011)
Log Message:
-----------
Phase 1 of autosave/load
Modified Paths:
--------------
trunk/18xx/LocalisedText.properties
trunk/18xx/rails/game/action/GameAction.java
trunk/18xx/rails/game/action/PossibleAction.java
trunk/18xx/rails/ui/swing/ActionPerformer.java
trunk/18xx/rails/ui/swing/GameUIManager.java
trunk/18xx/rails/ui/swing/ORUIManager.java
trunk/18xx/rails/ui/swing/ORWindow.java
trunk/18xx/rails/ui/swing/StartRoundWindow.java
trunk/18xx/rails/ui/swing/StatusWindow.java
trunk/18xx/rails/ui/swing/gamespecific/_1835/StatusWindow_1835.java
trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java
Added Paths:
-----------
trunk/18xx/rails/ui/swing/AutoLoadPoller.java
trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java
Modified: trunk/18xx/LocalisedText.properties
===================================================================
--- trunk/18xx/LocalisedText.properties 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/LocalisedText.properties 2011-03-26 20:42:51 UTC (rev 1501)
@@ -19,6 +19,8 @@
AutodiscardTrain=discard {0}-train
Autopass=Autopass
Autopasses={0} autopasses
+AutoSaveLoad=Autosave/load
+AutoSaveLoadOptions=Autosave/load options
BANK=Bank
BANK_SHARES=Bank shares
BASE_PRICE=<html>Base<br>Price</html>
@@ -439,6 +441,8 @@
OCLayBaseToken=Lay base token -- {0}
OCLayBaseTokenExecuted={0} lays base token for {1}
OK=OK
+On=On
+Off=Off
OPTIONS=Options
OR=or
ORWORTHINCR=OR +/-
@@ -600,6 +604,7 @@
StockSpaceIsConfiguredTwice=Stock space {0} is configured twice.
StockSpaceTypeConfiguredTwice=Stock space type {0} is configured twice
StockSpaceTypeUndefined=Stock space type {0} is undefined.
+Suspended=Suspended
SwapsPrivateForCertificate={0} swaps {1} for a {2}% share of {3}.
SwapPrivateForCertificate=Swap {0} for a {1}% share of {2}
SwapPrivateForCertificates=Swap {0} for {1} {2}% shares of {3}
Modified: trunk/18xx/rails/game/action/GameAction.java
===================================================================
--- trunk/18xx/rails/game/action/GameAction.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/game/action/GameAction.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -13,8 +13,8 @@
public static final int RELOAD = 6;
public static final int MAX_MODE = 6;
- private String[] name =
- new String[] { "Save", "Load", "Undo", "Undo!", "Redo", "Export", "Reload" };
+ private static String[] names =
+ new String[] { "Save", "Load", "Undo", "Undo!", "Redo", "Export", "Reload"};
// Server-side settings
protected int mode = -1;
@@ -65,6 +65,9 @@
}
public String toString() {
- return name[mode];
+ StringBuilder b = new StringBuilder(names[mode]);
+ if (filepath != null) b.append(" path="+filepath);
+ if (moveStackIndex > -1) b.append (" index="+moveStackIndex);
+ return b.toString();
}
}
Modified: trunk/18xx/rails/game/action/PossibleAction.java
===================================================================
--- trunk/18xx/rails/game/action/PossibleAction.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/game/action/PossibleAction.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -38,6 +38,7 @@
public PossibleAction() {
gameManager = GameManager.getInstance();
+ if (gameManager == null) return; // TODO If created in client ?!?!
Player player = gameManager.getCurrentPlayer();
if (player != null) {
playerName = player.getName();
Modified: trunk/18xx/rails/ui/swing/ActionPerformer.java
===================================================================
--- trunk/18xx/rails/ui/swing/ActionPerformer.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/ui/swing/ActionPerformer.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -5,7 +5,7 @@
public interface ActionPerformer {
- public void updateStatus();
+ public void updateStatus(boolean myTurn);
public boolean process(PossibleAction action);
Added: trunk/18xx/rails/ui/swing/AutoLoadPoller.java
===================================================================
--- trunk/18xx/rails/ui/swing/AutoLoadPoller.java (rev 0)
+++ trunk/18xx/rails/ui/swing/AutoLoadPoller.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -0,0 +1,157 @@
+package rails.ui.swing;
+
+import java.io.*;
+import java.util.Calendar;
+
+import javax.swing.SwingUtilities;
+
+import org.apache.log4j.Logger;
+
+import rails.game.action.GameAction;
+
+public class AutoLoadPoller extends Thread {
+
+ private GameUIManager guiMgr;
+ private String saveDirectory;
+ private String savePrefix;
+ private String ownPostfix;
+ private int pollingInterval;
+ private int pollingStatus;
+
+ private boolean pollingActive = false;
+
+ private String lastSavedFilenameFilepath;
+ private String lastSavedFilename = "";
+
+ public static final int OFF = 0;
+ public static final int ON = 1;
+ public static final int SUSPENDED = 2;
+
+ protected static Logger log =
+ Logger.getLogger(AutoLoadPoller.class.getPackage().getName());
+
+ public AutoLoadPoller (GameUIManager guiMgr, String saveDirectory, String savePrefix, String ownPostfix,
+ int status, int pollingInterval) {
+
+ this.guiMgr = guiMgr;
+ this.saveDirectory = saveDirectory;
+ this.savePrefix = savePrefix;
+ this.ownPostfix = ownPostfix;
+ this.pollingStatus = status;
+ this.pollingInterval = pollingInterval;
+
+ lastSavedFilenameFilepath = saveDirectory + "/" + savePrefix + ".last_rails";
+
+ }
+
+ @Override
+ public void run () {
+
+ log.info ("AutoLoadPoller started");
+
+ int secs, sleepTime;
+ String currentFilename;
+
+ for (;;) {
+
+ log.debug ("Polling cycle");
+ // Process
+ if (pollingActive && pollingStatus == ON) {
+ log.debug("Polling...");
+ try {
+ BufferedReader in = new BufferedReader (new FileReader (lastSavedFilenameFilepath));
+ currentFilename = in.readLine();
+ in.close();
+ log.debug("Read filename "+currentFilename+"; last saved filename "+lastSavedFilename);
+
+ if (!lastSavedFilename.equals(currentFilename)) {
+ final GameAction reload = new GameAction (GameAction.RELOAD);
+ reload.setFilepath(saveDirectory+"/"+currentFilename);
+ lastSavedFilename = currentFilename;
+
+ // The GUI must be accessed on the event dispatch thread only.
+ SwingUtilities.invokeLater (new Runnable() {
+ public void run() {
+ guiMgr.processOnServer(reload);
+ }
+ });
+
+ }
+
+ } catch (IOException e) {
+
+ }
+ }
+
+
+
+ secs = Calendar.getInstance().get(Calendar.SECOND);
+ try {
+ sleepTime = 1000 * (pollingInterval - secs%pollingInterval);
+ sleep (sleepTime);
+ } catch (InterruptedException e) {
+ continue;
+ }
+ }
+ // This thread never exits
+ }
+
+ public String getSaveDirectory() {
+ return saveDirectory;
+ }
+
+ public void setSaveDirectory(String saveDirectory) {
+ this.saveDirectory = saveDirectory;
+ }
+
+ public String getSavePrefix() {
+ return savePrefix;
+ }
+
+ public void setSavePrefix(String savePrefix) {
+ this.savePrefix = savePrefix;
+ }
+
+ public String getOwnPostfix() {
+ return ownPostfix;
+ }
+
+ public void setOwnPostfix(String ownPostfix) {
+ this.ownPostfix = ownPostfix;
+ }
+
+ public int getPollingInterval() {
+ return pollingInterval;
+ }
+
+ public void setPollingInterval(int pollingInterval) {
+ this.pollingInterval = pollingInterval;
+ }
+
+ public int getStatus() {
+ return pollingStatus;
+ }
+
+ public void setStatus(int status) {
+ this.pollingStatus = status;
+ }
+
+ public boolean isActive() {
+ return pollingActive;
+ }
+
+ public void setActive(boolean pollingActive) {
+ this.pollingActive = pollingActive;
+ log.debug("AutoLoad polling set to "+pollingActive);
+ }
+
+ public String getLastSavedFilename() {
+ return lastSavedFilename;
+ }
+
+ public void setLastSavedFilename(String lastSavedFilename) {
+ this.lastSavedFilename = lastSavedFilename;
+ }
+
+
+}
Property changes on: trunk/18xx/rails/ui/swing/AutoLoadPoller.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java
===================================================================
--- trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java (rev 0)
+++ trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -0,0 +1,146 @@
+/* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/ui/swing/elements/AutoSaveLoadDialog.java,v 1.8 2010/01/31 22:22:34 macfreek Exp $*/
+package rails.ui.swing;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
+import org.apache.log4j.Logger;
+
+import rails.ui.swing.elements.DialogOwner;
+import rails.ui.swing.elements.Spinner;
+import rails.util.LocalText;
+
+/**
+ * A generic dialog for presenting choices by radio buttons.
+ */
+public class AutoSaveLoadDialog extends JDialog implements ActionListener {
+
+ private static final long serialVersionUID = 1L;
+ GridBagConstraints gc;
+ JPanel optionsPane, buttonPane;
+ JButton okButton, cancelButton;
+ JRadioButton[] choiceButtons;
+ Spinner intervalSpinner;
+ Dimension size, optSize;
+ ButtonGroup group;
+ DialogOwner owner;
+
+ int status;
+ int interval;
+
+ private static final int NUM_OPTIONS = 3;
+
+ protected static Logger log =
+ Logger.getLogger(AutoSaveLoadDialog.class.getPackage().getName());
+
+ public AutoSaveLoadDialog(DialogOwner owner, int oldStatus, int oldInterval) {
+ super((Frame) null, "AutoSaveLoad settings", false); // Non-modal
+ this.owner = owner;
+ this.status = oldStatus;
+ this.interval = oldInterval;
+
+ initialize();
+ pack();
+
+ int x = 400;
+ int y = 400;
+ setLocation(x, y);
+
+ setVisible(true);
+ setAlwaysOnTop(true);
+ }
+
+ private void initialize() {
+ gc = new GridBagConstraints();
+
+ optionsPane = new JPanel();
+ buttonPane = new JPanel();
+
+ okButton = new JButton(LocalText.getText("OK"));
+ okButton.setMnemonic(KeyEvent.VK_O);
+ okButton.addActionListener(this);
+ buttonPane.add(okButton);
+
+ cancelButton = new JButton(LocalText.getText("Cancel"));
+ cancelButton.setMnemonic(KeyEvent.VK_C);
+ cancelButton.addActionListener(this);
+ buttonPane.add(cancelButton);
+
+ choiceButtons = new JRadioButton[3];
+ intervalSpinner = new Spinner (interval, 10, 0, 10);
+
+ getContentPane().setLayout(new GridBagLayout());
+ setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+
+ optionsPane.setLayout(new GridBagLayout());
+ // optionsPane.setBorder(BorderFactory.createLoweredBevelBorder());
+ optionsPane.add(new JLabel(LocalText.getText("AutoSaveLoadOptions")),
+ constraints(0, 0, 10, 10, 10, 10));
+
+ choiceButtons = new JRadioButton[NUM_OPTIONS];
+ group = new ButtonGroup();
+ String[] options = new String[] {
+ LocalText.getText("Off"),
+ LocalText.getText("On"),
+ LocalText.getText("Suspended")
+ };
+
+ for (int i = 0; i < NUM_OPTIONS; i++) {
+ choiceButtons[i] =
+ new JRadioButton(options[i], i == status);
+ optionsPane.add(choiceButtons[i], constraints(0, 1 + i, 0, 0, 0, 0));
+ choiceButtons[i].setPreferredSize(size);
+ group.add(choiceButtons[i]);
+ }
+
+ optionsPane.add (new JLabel("Polling interval:"), constraints (0,5,0,0,0,0));
+ intervalSpinner.setVisible(true);
+ optionsPane.add (intervalSpinner, constraints (1, 5, 0,0,0,0));
+ optionsPane.add (new JLabel("sec."), constraints (2,5,0,0,0,0));
+
+ getContentPane().add(optionsPane, constraints(0, 0, 0, 0, 0, 0));
+ getContentPane().add(buttonPane, constraints(0, 1, 0, 0, 0, 0));
+ }
+
+ private GridBagConstraints constraints(int gridx, int gridy, int leftinset,
+ int topinset, int rightinset, int bottominset) {
+ if (gridx >= 0) gc.gridx = gridx;
+ if (gridy >= 0) gc.gridy = gridy;
+ gc.fill = GridBagConstraints.BOTH;
+ gc.weightx = 0.5;
+ gc.weighty = 0.5;
+ if (leftinset >= 0) gc.insets.left = leftinset;
+ if (topinset >= 0) gc.insets.top = topinset;
+ if (rightinset >= 0) gc.insets.right = rightinset;
+ if (bottominset >= 0) gc.insets.bottom = bottominset;
+
+ return gc;
+ }
+
+ public void actionPerformed(ActionEvent arg0) {
+ if (arg0.getSource().equals(okButton)) {
+ for (int i = 0; i < NUM_OPTIONS; i++) {
+ if (choiceButtons[i].isSelected()) {
+ status = i;
+ break;
+ }
+ }
+ interval = ((Integer) intervalSpinner.getValue()).intValue();
+ } else if (arg0.getSource().equals(cancelButton)) {
+ status = -1;
+ }
+ this.setVisible(false);
+ this.dispose();
+ owner.dialogActionPerformed();
+ }
+
+ public synchronized int getStatus() {
+ return status;
+ }
+
+ public synchronized int getInterval() {
+ return interval;
+ }
+}
Property changes on: trunk/18xx/rails/ui/swing/AutoSaveLoadDialog.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/18xx/rails/ui/swing/GameUIManager.java
===================================================================
--- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -4,7 +4,7 @@
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
-import java.io.File;
+import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -60,11 +60,20 @@
protected String saveDirectory;
protected String savePattern;
protected String saveExtension;
+ protected String savePrefix;
protected String saveSuffixSpec = "";
protected String saveSuffix = "";
protected String providedName = null;
protected SimpleDateFormat saveDateTimeFormat;
protected File lastFile, lastDirectory;
+
+ protected boolean autoSaveLoadInitialized = false;
+ protected int autoSaveLoadStatus = 0;
+ protected int autoSaveLoadPollingInterval = 30;
+ protected AutoLoadPoller autoLoadPoller = null;
+ protected boolean myTurn = true;
+ protected String lastSavedFilenameFilepath;
+ protected String lastSavedFilename = "";
protected WindowSettings windowSettings;
@@ -88,6 +97,7 @@
instance = this;
this.gameManager = gameManager;
uiHints = gameManager.getUIHints();
+ savePrefix = gameManager.getGameName();
initWindowSettings();
initSaveSettings();
@@ -133,7 +143,9 @@
}
saveSuffixSpec = Config.get("save.filename.suffix");
if (Util.hasValue(saveSuffixSpec) && !saveSuffixSpec.equals(NEXT_PLAYER_SUFFIX)) {
- saveSuffix = "_" + saveSuffixSpec;
+ saveSuffix = saveSuffixSpec;
+ } else {
+ saveSuffix = getPlayerNames().get(0);
}
}
@@ -241,30 +253,26 @@
// Follow-up the result
log.debug("==Result from server: " + result);
reportWindow.updateLog();
- /*
- if (DisplayBuffer.getAutoDisplay()) {
- if (displayServerMessage()) {
- // Interrupt processing.
- // Will be continued via dialogActionPerformed().
- return true;
+
+ // Process any autosaving and turn relinquishing, resp. autoloading and turn pickup
+ if (autoSaveLoadInitialized && autoSaveLoadStatus != AutoLoadPoller.OFF) {
+ Player newPlayer = getCurrentPlayer();
+ boolean wasMyTurn = myTurn;
+ myTurn = newPlayer.getName().equals(saveSuffix);
+ if (newPlayer != player) {
+ if (wasMyTurn && !myTurn) {
+ log.info ("Relinquishing turn to "+newPlayer.getName());
+ autoSave (newPlayer.getName());
+ autoLoadPoller.setLastSavedFilename(lastSavedFilename);
+ autoLoadPoller.setActive(true);
+ } else if (!wasMyTurn && myTurn) {
+ log.info ("Resuming turn as "+saveSuffix);
+ autoLoadPoller.setActive(false);
+ }
}
- }*/
+ }
}
- // End of game checks
-// if (gameManager.isGameOver()) {
-//
-// statusWindow.reportGameOver();
-//
-// return true;
-//
-// }
-// else if (gameManager.getBank().isJustBroken()) {
-//
-// statusWindow.reportBankBroken();
-//
-// }
-
// Check in which round we are now,
// and make sure that the right window is active.
updateUI();
@@ -450,19 +458,19 @@
if (StartRoundWindow.class.isAssignableFrom(activeWindow.getClass())) {
log.debug("Updating Start round window");
- startRoundWindow.updateStatus();
+ startRoundWindow.updateStatus(myTurn);
startRoundWindow.setSRPlayerTurn(startRound.getCurrentPlayerIndex());
} else if (StatusWindow.class.isAssignableFrom(activeWindow.getClass())) {
// } else {
log.debug("Updating Stock (status) round window");
- statusWindow.updateStatus();
+ statusWindow.updateStatus(myTurn);
} else if (ORWindow.class.isAssignableFrom(activeWindow.getClass())) {
log.debug("Updating Operating round window");
- orUIManager.updateStatus();
+ orUIManager.updateStatus(myTurn);
}
updateStatus(activeWindow);
@@ -648,16 +656,48 @@
RepayLoans action = (RepayLoans) currentDialogAction;
int selected = dialog.getSelectedOption();
action.setNumberTaken(action.getMinNumber() + selected);
+
} else if (currentDialog instanceof MessageDialog) {
// Nothing to do
currentDialogAction = null; // Should already be null
+
+ } else if (currentDialog instanceof AutoSaveLoadDialog) {
+
+ autoSaveLoadGame2 ((AutoSaveLoadDialog)currentDialog);
+
} else {
return;
}
}
- processOnServer(currentDialogAction);
+ if (currentDialogAction != null) processOnServer(currentDialogAction);
+
}
+
+ protected void autoSave (String newPlayer) {
+ lastSavedFilename = savePrefix + "_"
+ + saveDateTimeFormat.format(new Date()) + "_"
+ + newPlayer + "."
+ + saveExtension;
+ GameAction saveAction = new GameAction(GameAction.SAVE);
+ saveAction.setFilepath(saveDirectory + "/" + lastSavedFilename);
+ log.debug("Autosaving to "+lastSavedFilename);
+ processOnServer (saveAction);
+
+ try {
+ File f = new File (lastSavedFilenameFilepath);
+ PrintWriter out = new PrintWriter (new FileWriter (f));
+ out.println (lastSavedFilename);
+ out.close();
+ } catch (IOException e) {
+ log.error ("Exception whilst autosaving file '"+lastSavedFilenameFilepath+"'", e);
+ }
+
+ }
+
+ protected boolean pollingIsOn () {
+ return autoLoadPoller != null && autoLoadPoller.getStatus() == AutoLoadPoller.ON;
+ }
/** Stub, can be overridden by subclasses */
protected boolean checkGameSpecificDialogAction() {
@@ -713,8 +753,8 @@
if (providedName != null) {
filename = providedName;
} else {
- filename = saveDirectory + "/" + gameManager.getGameName() + "_"
- + saveDateTimeFormat.format(new Date())
+ filename = saveDirectory + "/" + savePrefix + "_"
+ + saveDateTimeFormat.format(new Date())+ "_"
+ saveSuffix + ".txt";
}
@@ -747,11 +787,11 @@
filename = providedName;
} else {
if (NEXT_PLAYER_SUFFIX.equals(saveSuffixSpec)) {
- saveSuffix = "_" + gameManager.getCurrentPlayer().getName().replaceAll("[^-\\w\\.]", "_");
+ saveSuffix = gameManager.getCurrentPlayer().getName().replaceAll("[^-\\w\\.]", "_");
}
filename =
- saveDirectory + "/" + gameManager.getGameName() + "_"
- + saveDateTimeFormat.format(new Date())
+ saveDirectory + "/" + savePrefix + "_"
+ + saveDateTimeFormat.format(new Date()) + "_"
+ saveSuffix + "."
+ saveExtension;
}
@@ -767,7 +807,17 @@
String filepath = selectedFile.getPath();
saveDirectory = selectedFile.getParent();
if (!selectedFile.getName().equalsIgnoreCase(proposedFile.getName())) {
- providedName = filepath;
+ // User has not accepted the default name but entered a different one.
+ // Check the new name. If only the prefix has changed, only remember that part.
+ String[] proposedParts = proposedFile.getName().split("_", 2);
+ String[] selectedParts = selectedFile.getName().split("_", 2);
+ if (!proposedParts[0].equals(selectedParts[0])
+ && proposedParts[1].equals(selectedParts[1])) {
+ savePrefix = selectedParts[0];
+ } else {
+ // Otherwise, remember and keep using the whole filename.
+ providedName = filepath;
+ }
}
saveAction.setFilepath(filepath);
processOnServer(saveAction);
@@ -791,7 +841,81 @@
}
- public void setSaveDirectory(String saveDirectory) {
+ public void autoSaveLoadGame () {
+
+ AutoSaveLoadDialog dialog = new AutoSaveLoadDialog (this,
+ autoSaveLoadStatus,
+ autoSaveLoadPollingInterval);
+ setCurrentDialog(dialog, null);
+ }
+
+ public void autoSaveLoadGame2 (AutoSaveLoadDialog dialog) {
+
+ autoSaveLoadStatus = dialog.getStatus();
+ autoSaveLoadPollingInterval = dialog.getInterval();
+
+ if (autoLoadPoller == null && autoSaveLoadStatus > 0) {
+ autoLoadPoller = new AutoLoadPoller (this, saveDirectory, savePrefix,
+ saveSuffix, autoSaveLoadStatus, autoSaveLoadPollingInterval);
+ autoLoadPoller.start();
+ } else if (autoLoadPoller != null) {
+ autoLoadPoller.setStatus(autoSaveLoadStatus);
+ autoLoadPoller.setPollingInterval(autoSaveLoadPollingInterval);
+ }
+ log.debug("AutoSaveLoad parameters: status="+autoSaveLoadStatus
+ +" interval="+autoSaveLoadPollingInterval);
+
+ if (autoLoadPoller != null && autoSaveLoadStatus != AutoLoadPoller.OFF
+ && !autoSaveLoadInitialized) {
+
+ /* The first time (only) we use the normal save process,
+ * so the player can select a directory, and change
+ * the prefix if so desired.
+ */
+ GameAction saveAction = new GameAction(GameAction.SAVE);
+ saveGame (saveAction);
+ File lastSavedFile = new File (saveAction.getFilepath());
+ saveDirectory = lastSavedFile.getParentFile().getPath();
+
+ /* Now also save the "last saved file" file */
+ String lastSavedFilename = lastSavedFile.getName();
+ lastSavedFilenameFilepath = saveDirectory + "/" + savePrefix + ".last_rails";
+ try {
+ File f = new File (lastSavedFilenameFilepath);
+ PrintWriter out = new PrintWriter (new FileWriter (f));
+ out.println (lastSavedFilename);
+ out.close();
+ autoSaveLoadInitialized = true;
+ } catch (IOException e) {
+ log.error ("Exception whilst creating .last_rails file '"
+ + lastSavedFilenameFilepath + "'", e);
+ }
+ }
+
+ myTurn = getCurrentPlayer().getName().equals(saveSuffix);
+
+ if (!myTurn) {
+ // Start autoload polling
+ autoLoadPoller.setActive(autoSaveLoadStatus == AutoLoadPoller.ON && !myTurn);
+ log.debug("MyTurn="+myTurn+" poller status="+autoLoadPoller.getStatus()
+ +" active="+autoLoadPoller.isActive());
+
+ } else {
+ myTurn = true;
+ log.debug("MyTurn="+myTurn);
+ }
+
+ }
+
+ public boolean isMyTurn() {
+ return myTurn;
+ }
+
+ public void setMyTurn(boolean myTurn) {
+ this.myTurn = myTurn;
+ }
+
+ public void setSaveDirectory(String saveDirectory) {
this.saveDirectory = saveDirectory;
}
Modified: trunk/18xx/rails/ui/swing/ORUIManager.java
===================================================================
--- trunk/18xx/rails/ui/swing/ORUIManager.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/ui/swing/ORUIManager.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -498,7 +498,7 @@
} else {
log.debug("Allocation is unknown, asking for it");
setLocalStep(SELECT_PAYOUT);
- updateStatus(action);
+ updateStatus(action, true);
// Locally update revenue if we don't inform the server yet.
orPanel.setRevenue(orCompIndex, amount);
@@ -1443,13 +1443,13 @@
}
- public void updateStatus() {
+ public void updateStatus(boolean myTurn) {
- updateStatus(null);
+ updateStatus(null, myTurn);
}
- public void updateStatus(PossibleAction actionToComplete) {
+ public void updateStatus(PossibleAction actionToComplete, boolean myTurn) {
mapRelatedActions.clear();
@@ -1457,6 +1457,8 @@
messagePanel.setMessage(null);
+ if (!myTurn) return;
+
if (actionToComplete != null) {
log.debug("ExecutedAction: " + actionToComplete);
}
Modified: trunk/18xx/rails/ui/swing/ORWindow.java
===================================================================
--- trunk/18xx/rails/ui/swing/ORWindow.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/ui/swing/ORWindow.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -192,12 +192,12 @@
requestFocus();
}
- public void updateStatus() {
+ public void updateStatus(boolean myTurn) {
// Safety check. Do nothing if this method is called outside Operating Rounds,
// for instance when a token is exchanged during a Stock Round.
if (!(gameUIManager.getCurrentRound() instanceof OperatingRound)) return;
- orUIManager.updateStatus();
+ orUIManager.updateStatus(myTurn);
requestFocus();
}
Modified: trunk/18xx/rails/ui/swing/StartRoundWindow.java
===================================================================
--- trunk/18xx/rails/ui/swing/StartRoundWindow.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/ui/swing/StartRoundWindow.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -374,7 +374,7 @@
}
- public void updateStatus() {
+ public void updateStatus(boolean myTurn) {
StartItem item;
int i, j;
@@ -384,6 +384,8 @@
}
// Unselect the selected private
dummyButton.setSelected(true);
+
+ if (!myTurn) return;
// For debugging
for (PossibleAction action : possibleActions.getList()) {
Modified: trunk/18xx/rails/ui/swing/StatusWindow.java
===================================================================
--- trunk/18xx/rails/ui/swing/StatusWindow.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/ui/swing/StatusWindow.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -31,6 +31,8 @@
protected static final String SAVE_CMD = "Save";
protected static final String RELOAD_CMD = "Reload";
+
+ protected static final String AUTOSAVELOAD_CMD = "AutoSaveLoad";
protected static final String EXPORT_CMD = "Export";
@@ -80,8 +82,7 @@
private JMenuItem menuItem;
- private ActionMenuItem saveItem;
- private ActionMenuItem reloadItem;
+ private ActionMenuItem actionMenuItem;
private ActionMenuItem undoItem, forcedUndoItem, redoItem, redoItem2;
@@ -109,27 +110,36 @@
moderatorMenu.setMnemonic(KeyEvent.VK_M);
specialMenu.setMnemonic(KeyEvent.VK_S);
- saveItem = new ActionMenuItem(LocalText.getText("SAVE"));
- saveItem.setActionCommand(SAVE_CMD);
- saveItem.setMnemonic(KeyEvent.VK_S);
- saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
+ actionMenuItem = new ActionMenuItem(LocalText.getText("SAVE"));
+ actionMenuItem.setActionCommand(SAVE_CMD);
+ actionMenuItem.setMnemonic(KeyEvent.VK_S);
+ actionMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
ActionEvent.ALT_MASK));
- saveItem.addActionListener(this);
- saveItem.setEnabled(true);
- saveItem.setPossibleAction(new GameAction(GameAction.SAVE));
- fileMenu.add(saveItem);
+ actionMenuItem.addActionListener(this);
+ actionMenuItem.setEnabled(true);
+ actionMenuItem.setPossibleAction(new GameAction(GameAction.SAVE));
+ fileMenu.add(actionMenuItem);
- reloadItem = new ActionMenuItem(LocalText.getText("Reload"));
- reloadItem.setActionCommand(RELOAD_CMD);
- reloadItem.setMnemonic(KeyEvent.VK_R);
- reloadItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R,
+ actionMenuItem = new ActionMenuItem(LocalText.getText("Reload"));
+ actionMenuItem.setActionCommand(RELOAD_CMD);
+ actionMenuItem.setMnemonic(KeyEvent.VK_R);
+ actionMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R,
ActionEvent.ALT_MASK));
- reloadItem.addActionListener(this);
- reloadItem.setEnabled(true);
- reloadItem.setPossibleAction(new GameAction(GameAction.RELOAD));
- fileMenu.add(reloadItem);
+ actionMenuItem.addActionListener(this);
+ actionMenuItem.setEnabled(true);
+ actionMenuItem.setPossibleAction(new GameAction(GameAction.RELOAD));
+ fileMenu.add(actionMenuItem);
- // export menu item
+ menuItem = new JMenuItem(LocalText.getText("AutoSaveLoad"));
+ menuItem.setActionCommand(AUTOSAVELOAD_CMD);
+ menuItem.setMnemonic(KeyEvent.VK_A);
+ menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,
+ ActionEvent.ALT_MASK));
+ menuItem.addActionListener(this);
+ menuItem.setEnabled(true);
+ fileMenu.add(menuItem);
+
+ // export menu item
// exportItem = new ActionMenuItem(LocalText.getText("EXPORT"));
// exportItem.setActionCommand(EXPORT_CMD);
// exportItem.addActionListener(this);
@@ -182,7 +192,7 @@
menuItem.addActionListener(this);
optMenu.add(menuItem);
- // new config menu only for non legacy configgfiles
+ // new config menu only for non legacy configfiles
if (!Config.isLegacyConfigFile()) {
menuItem = new JCheckBoxMenuItem(LocalText.getText("CONFIG"));
menuItem.setName(CONFIG_CMD);
@@ -289,9 +299,6 @@
setSize(800, 300);
-// Rectangle bounds = graphicsConfiguration.getBounds();
-// setLocation(bounds.x+ 25, bounds.y + 450);
-
buttonPanel.setBorder(BorderFactory.createEtchedBorder());
buttonPanel.setOpaque(false);
@@ -350,17 +357,13 @@
forcedUndoItem.setEnabled(false);
redoItem.setEnabled(false);
redoItem2.setEnabled(false);
- // SAVE is always enabled
-
+ // SAVE, RELOAD, AUTOSAVELOAD are always enabled
+
List<GameAction> gameActions =
possibleActions.getType(GameAction.class);
if (gameActions != null) {
for (GameAction na : gameActions) {
switch (na.getMode()) {
- // SAVE is now enabled by default
- //case GameAction.SAVE:
- // saveItem.setPossibleAction(na);
- // break;
case GameAction.UNDO:
undoItem.setEnabled(true);
undoItem.setPossibleAction(na);
@@ -425,11 +428,13 @@
}
- public void updateStatus() {
+ public void updateStatus(boolean myTurn) {
if (!(currentRound instanceof StockRound || currentRound instanceof EndOfGameRound))
return;
+ if (!myTurn) return;
+
// Moved here from StatusWindow_1856. It's getting generic...
if (possibleActions.contains(DiscardTrain.class)) {
immediateAction = possibleActions.getType(DiscardTrain.class).get(0);
@@ -635,6 +640,8 @@
gameUIManager.orWindow.setVisible(((JMenuItem) actor.getSource()).isSelected());
} else if (command.equals(CONFIG_CMD)) {
gameUIManager.configWindow.setVisible(((JMenuItem) actor.getSource()).isSelected());
+ } else if (command.equals(AUTOSAVELOAD_CMD)) {
+ gameUIManager.autoSaveLoadGame();
} else if (executedAction == null) {
;
} else if (executedAction instanceof GameAction) {
Modified: trunk/18xx/rails/ui/swing/gamespecific/_1835/StatusWindow_1835.java
===================================================================
--- trunk/18xx/rails/ui/swing/gamespecific/_1835/StatusWindow_1835.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/ui/swing/gamespecific/_1835/StatusWindow_1835.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -31,10 +31,10 @@
}
@Override
- public void updateStatus() {
+ public void updateStatus(boolean myTurn) {
RoundI currentRound = gameUIManager.getCurrentRound();
if (!(currentRound instanceof PrussianFormationRound)) {
- super.updateStatus();
+ super.updateStatus(myTurn);
} else if (possibleActions.contains(FoldIntoPrussian.class)) {
immediateAction = possibleActions.getType(FoldIntoPrussian.class).get(0);
} else if (possibleActions.contains(DiscardTrain.class)) {
Modified: trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java
===================================================================
--- trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java 2011-03-17 21:16:44 UTC (rev 1500)
+++ trunk/18xx/rails/ui/swing/gamespecific/_1856/StatusWindow_1856.java 2011-03-26 20:42:51 UTC (rev 1501)
@@ -20,10 +20,10 @@
}
@Override
- public void updateStatus() {
+ public void updateStatus(boolean myTurn) {
RoundI currentRound = gameUIManager.getCurrentRound();
if (!(currentRound instanceof CGRFormationRound)) {
- super.updateStatus();
+ super.updateStatus(myTurn);
} else if (possibleActions.contains(RepayLoans.class)) {
//RepayLoans action = possibleActions.getType(RepayLoans.class).get(0);
//repayLoans (action);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-17 21:16:50
|
Revision: 1500
http://rails.svn.sourceforge.net/rails/?rev=1500&view=rev
Author: evos
Date: 2011-03-17 21:16:44 +0000 (Thu, 17 Mar 2011)
Log Message:
-----------
Fix for bug 3207870: added new class ShareSellingRound_1856 with code (copied from StockRound_1856) to prevent that a 5% CGR sale during emergency selling lowers the CGR price.
Modified Paths:
--------------
trunk/18xx/data/1856/Game.xml
trunk/18xx/rails/game/GameManager.java
Added Paths:
-----------
trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java
Modified: trunk/18xx/data/1856/Game.xml
===================================================================
--- trunk/18xx/data/1856/Game.xml 2011-03-15 22:27:07 UTC (rev 1499)
+++ trunk/18xx/data/1856/Game.xml 2011-03-17 21:16:44 UTC (rev 1500)
@@ -17,6 +17,7 @@
<NoSaleOfJustBoughtShare/>
</StockRound>
<OperatingRound class="rails.game.specific._1856.OperatingRound_1856"/>
+ <ShareSellingRound class="rails.game.specific._1856.ShareSellingRound_1856"/>
<PlayerShareLimit percentage="60"/>
<BankPoolLimit percentage="50"/>
</GameParameters>
Modified: trunk/18xx/rails/game/GameManager.java
===================================================================
--- trunk/18xx/rails/game/GameManager.java 2011-03-15 22:27:07 UTC (rev 1499)
+++ trunk/18xx/rails/game/GameManager.java 2011-03-17 21:16:44 UTC (rev 1500)
@@ -37,6 +37,8 @@
protected Class<? extends StockRound> stockRoundClass = StockRound.class;
protected Class<? extends OperatingRound> operatingRoundClass =
OperatingRound.class;
+ protected Class<? extends ShareSellingRound> shareSellingRoundClass
+ = ShareSellingRound.class;
// Variable UI Class names
protected String gameUIManagerClassName = GuiDef.getDefaultClassName(GuiDef.ClassName.GAME_UI_MANAGER);
@@ -176,7 +178,7 @@
protected List<String> nextPlayerMessages = new ArrayList<String>();
/**
- * The ReportBuffer collectes messages to be shown in the Game Report.
+ * The ReportBuffer collects messages to be shown in the Game Report.
*/
protected ReportBuffer reportBuffer;
@@ -356,6 +358,20 @@
}
}
+ // ShareSellingRound class
+ Tag ssrTag = gameParmTag.getChild("ShareSellingRound");
+ if (ssrTag != null) {
+ String ssrClassName =
+ ssrTag.getAttributeAsString("class", "rails.game.ShareSellingRound");
+ try {
+ shareSellingRoundClass =
+ Class.forName(ssrClassName).asSubclass(ShareSellingRound.class);
+ } catch (ClassNotFoundException e) {
+ throw new ConfigurationException("Cannot find class "
+ + ssrClassName, e);
+ }
+ }
+
/* Max. % of shares of one company that a player may hold */
Tag shareLimitTag = gameParmTag.getChild("PlayerShareLimit");
if (shareLimitTag != null) {
@@ -756,7 +772,7 @@
interruptedRound = getCurrentRound();
// check if other companies can be dumped
- createRound (ShareSellingRound.class, interruptedRound)
+ createRound (shareSellingRoundClass, interruptedRound)
.start(player, cashToRaise, cashNeedingCompany,
!problemDumpOtherCompanies || forcedSellingCompanyDump);
// the last parameter indicates if the dump of other companies is allowed, either this is explicit or
Added: trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java
===================================================================
--- trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java (rev 0)
+++ trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java 2011-03-17 21:16:44 UTC (rev 1500)
@@ -0,0 +1,43 @@
+package rails.game.specific._1856;
+
+import rails.game.*;
+import rails.game.action.BuyCertificate;
+import rails.game.state.IntegerState;
+import rails.util.LocalText;
+
+/** Needed to copy behaviour on share selling from StockRound_1856. */
+public class ShareSellingRound_1856 extends ShareSellingRound {
+
+ /* Cope with multiple 5% share sales in one turn */
+ private IntegerState sharesSoldSoFar;
+ private IntegerState squaresDownSoFar;
+
+ public ShareSellingRound_1856 (GameManagerI aGameManager,
+ RoundI parentRound) {
+ super (aGameManager, parentRound);
+
+ sharesSoldSoFar = new IntegerState("CGR_SharesSoldSoFar", 0);
+ squaresDownSoFar = new IntegerState("CGR_SquaresDownSoFar", 0);
+ }
+
+ @Override
+ protected void adjustSharePrice (PublicCompanyI company, int numberSold, boolean soldBefore) {
+
+ if (!company.canSharePriceVary()) return;
+
+ int numberOfSpaces = numberSold;
+ if (company instanceof PublicCompany_CGR) {
+ if (company.getShareUnit() == 5) {
+ // Take care for selling 5% shares in multiple blocks per turn
+ numberOfSpaces
+ = (sharesSoldSoFar.intValue() + numberSold)/2
+ - squaresDownSoFar.intValue();
+ sharesSoldSoFar.add(numberSold);
+ squaresDownSoFar.add(numberOfSpaces);
+ }
+ }
+
+ super.adjustSharePrice (company, numberOfSpaces, soldBefore);
+ }
+
+}
Property changes on: trunk/18xx/rails/game/specific/_1856/ShareSellingRound_1856.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-15 22:27:13
|
Revision: 1499
http://rails.svn.sourceforge.net/rails/?rev=1499&view=rev
Author: evos
Date: 2011-03-15 22:27:07 +0000 (Tue, 15 Mar 2011)
Log Message:
-----------
Added "sell train to foreigners" feature of 1844 and 1824
Modified Paths:
--------------
trunk/18xx/LocalisedText.properties
trunk/18xx/rails/game/GameDef.java
trunk/18xx/rails/game/GameManager.java
trunk/18xx/rails/game/OperatingRound.java
trunk/18xx/rails/game/TileManager.java
trunk/18xx/rails/game/TrainManager.java
Modified: trunk/18xx/LocalisedText.properties
===================================================================
--- trunk/18xx/LocalisedText.properties 2011-03-14 21:18:55 UTC (rev 1498)
+++ trunk/18xx/LocalisedText.properties 2011-03-15 22:27:07 UTC (rev 1499)
@@ -500,6 +500,7 @@
ReleasesTrains=Makes {0}-trains available for purchasing
Reload=Reload
RemainingTiles=Remaining tiles
+RemoveTrain=An unsold {0}-train is removed from the game
RepayLoans=Repay loan(s)
RepayLoan=Repay {0} loan(s) of {1} for {2}
REPORT=Report Window
Modified: trunk/18xx/rails/game/GameDef.java
===================================================================
--- trunk/18xx/rails/game/GameDef.java 2011-03-14 21:18:55 UTC (rev 1498)
+++ trunk/18xx/rails/game/GameDef.java 2011-03-15 22:27:07 UTC (rev 1499)
@@ -18,7 +18,8 @@
TREASURY_SHARE_LIMIT(50),
FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS(false),
SKIP_FIRST_STOCK_ROUND(false),
- NO_SALE_OF_JUST_BOUGHT_CERT(false);
+ NO_SALE_OF_JUST_BOUGHT_CERT(false),
+ REMOVE_TRAIN_BEFORE_SR(false);
private Object defaultValue;
Modified: trunk/18xx/rails/game/GameManager.java
===================================================================
--- trunk/18xx/rails/game/GameManager.java 2011-03-14 21:18:55 UTC (rev 1498)
+++ trunk/18xx/rails/game/GameManager.java 2011-03-15 22:27:07 UTC (rev 1499)
@@ -642,6 +642,7 @@
if (bank.isBroken() && gameEndsAfterSetOfORs) {
finishGame();
} else {
+ ((OperatingRound)round).checkForeignSales();
startStockRound();
}
}
Modified: trunk/18xx/rails/game/OperatingRound.java
===================================================================
--- trunk/18xx/rails/game/OperatingRound.java 2011-03-14 21:18:55 UTC (rev 1498)
+++ trunk/18xx/rails/game/OperatingRound.java 2011-03-15 22:27:07 UTC (rev 1499)
@@ -7,8 +7,7 @@
import rails.game.action.*;
import rails.game.correct.ClosePrivate;
import rails.game.correct.OperatingCost;
-import rails.game.move.CashMove;
-import rails.game.move.MapChange;
+import rails.game.move.*;
import rails.game.special.*;
import rails.game.state.*;
import rails.util.LocalText;
@@ -1822,6 +1821,7 @@
operatingCompany.get().buyTrain(train, price);
if (oldHolder == ipo) {
train.getType().addToBoughtFromIPO();
+ trainManager.setAnyTrainBought(true);
// Clone the train if infinitely available
if (train.getType().hasInfiniteAmount()) {
ipo.addTrain(train.getType().cloneTrain());
@@ -2834,7 +2834,7 @@
public void payLoanInterest () {
int amount = operatingCompany.get().getCurrentLoanValue()
- * operatingCompany.get().getLoanInterestPct() / 100;
+ * operatingCompany.get().getLoanInterestPct() / 100;
new CashMove (operatingCompany.get(), bank, amount);
DisplayBuffer.add(LocalText.getText("CompanyPaysLoanInterest",
operatingCompany.get().getName(),
@@ -2844,6 +2844,15 @@
Bank.format(operatingCompany.get().getValuePerLoan())));
}
+ public void checkForeignSales() {
+ if (getGameParameterAsBoolean(GameDef.Parm.REMOVE_TRAIN_BEFORE_SR)
+ && trainManager.isAnyTrainBought()) {
+ TrainI train = trainManager.getAvailableNewTrains().get(0);
+ if (train.getType().hasInfiniteAmount()) return;
+ new ObjectMove (train, ipo, scrapHeap);
+ ReportBuffer.add(LocalText.getText("RemoveTrain", train.getName()));
+ }
+ }
/* TODO This is just a start of a possible approach to a Help system */
@Override
Modified: trunk/18xx/rails/game/TileManager.java
===================================================================
--- trunk/18xx/rails/game/TileManager.java 2011-03-14 21:18:55 UTC (rev 1498)
+++ trunk/18xx/rails/game/TileManager.java 2011-03-15 22:27:07 UTC (rev 1499)
@@ -38,7 +38,6 @@
if (tileDefFileName == null)
throw new ConfigurationException(LocalText.getText("NoTilesXML"));
- //directories.add("data/" + ComponentManager.getGameName());
directories.add("data/" + GameManager.getInstance().getGameName());
Tag tileDefTop =
Tag.findTopTagInFile(tileDefFileName, directories, "Tiles");
Modified: trunk/18xx/rails/game/TrainManager.java
===================================================================
--- trunk/18xx/rails/game/TrainManager.java 2011-03-14 21:18:55 UTC (rev 1498)
+++ trunk/18xx/rails/game/TrainManager.java 2011-03-15 22:27:07 UTC (rev 1499)
@@ -3,6 +3,7 @@
import java.util.*;
+import rails.game.state.BooleanState;
import rails.game.state.IntegerState;
import rails.util.LocalText;
import rails.util.Tag;
@@ -16,8 +17,10 @@
protected Map<String, TrainI> trainMap =
new HashMap<String, TrainI>();
+
+ private boolean removeTrain = false;
+
-
// Dynamic attributes
protected Portfolio unavailable = null;
@@ -32,6 +35,9 @@
protected GameManagerI gameManager = null;
protected Bank bank = null;
+
+ /** Required for the sell-train-to-foreigners feature of some games */
+ protected BooleanState anyTrainBought = new BooleanState ("AnyTrainBought", false);
// Non-game attributes
protected Portfolio ipo = null;
@@ -78,7 +84,7 @@
Tag rulesTag = tag.getChild("TrainBuyingRules");
if (rulesTag != null) {
// A 1851 special
- GameManager.getInstance().setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS,
+ gameManager.setGameParameter(GameDef.Parm.FIXED_PRICE_TRAINS_BETWEEN_PRESIDENTS,
rulesTag.getChild("FaceValueIfDifferentPresidents") != null);
}
@@ -96,6 +102,14 @@
mTrainTypes.get(type.getRustedTrainTypeName()).setPermanent(false);
}
}
+
+ // Are trains sold to foreigners?
+ Tag removeTrainTag = tag.getChild("RemoveTrainBeforeSR");
+ if (removeTrainTag != null) {
+ // Trains "bought by foreigners" (1844, 1824)
+ removeTrain = true; // completed in finishConfiguration()
+ }
+
}
public void finishConfiguration (GameManagerI gameManager)
@@ -112,8 +126,13 @@
// By default, set the first train type to "available".
newTypeIndex.set(0);
lTrainTypes.get(newTypeIndex.intValue()).setAvailable(bank);
- }
+ // Trains "bought by foreigners" (1844, 1824)
+ if (removeTrain) {
+ gameManager.setGameParameter(GameDef.Parm.REMOVE_TRAIN_BEFORE_SR, true);
+ }
+}
+
public void addTrain (String uniqueID, TrainI train) {
trainMap.put(uniqueID, train);
}
@@ -218,7 +237,7 @@
}
return b.toString();
}
-
+
public TrainTypeI getTypeByName(String name) {
return mTrainTypes.get(name);
}
@@ -239,4 +258,13 @@
return phaseHasChanged;
}
+ public boolean isAnyTrainBought () {
+ return anyTrainBought.booleanValue();
+ }
+
+ public void setAnyTrainBought (boolean newValue) {
+ if (isAnyTrainBought() != newValue) {
+ anyTrainBought.set(newValue);
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-14 21:19:02
|
Revision: 1498
http://rails.svn.sourceforge.net/rails/?rev=1498&view=rev
Author: evos
Date: 2011-03-14 21:18:55 +0000 (Mon, 14 Mar 2011)
Log Message:
-----------
18VA nap fixed
Modified Paths:
--------------
trunk/18xx/data/18VA/Game.xml
trunk/18xx/data/18VA/Map.xml
trunk/18xx/rails/game/MapManager.java
trunk/18xx/rails/ui/swing/hexmap/GUIHex.java
Modified: trunk/18xx/data/18VA/Game.xml
===================================================================
--- trunk/18xx/data/18VA/Game.xml 2011-03-14 15:52:15 UTC (rev 1497)
+++ trunk/18xx/data/18VA/Game.xml 2011-03-14 21:18:55 UTC (rev 1498)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<ComponentManager>
<Component name="GameManager" class="rails.game.GameManager">
- <Game name="1830"/>
+ <Game name="18VA"/>
<!-- GAME OPTIONS must have:
- a name, which must also exist as an entry in LocalText.properties,
- optionally 'type="toggle"', which has the effect that the
@@ -15,7 +15,6 @@
<!-- The options in Game.xml are not currently used.
See GamesList.xml for the real ones.
-->
- <GameOption name="Variant" values="Basegame,Pere Marquette" default="Basegame" />
<GameParameters>
<PlayerShareLimit percentage="60">
<!-- Option "NumberOfPlayers" is automatically set
Modified: trunk/18xx/data/18VA/Map.xml
===================================================================
--- trunk/18xx/data/18VA/Map.xml 2011-03-14 15:52:15 UTC (rev 1497)
+++ trunk/18xx/data/18VA/Map.xml 2011-03-14 21:18:55 UTC (rev 1498)
@@ -4,7 +4,7 @@
<Hex name="B5" tile="-10" city="Hagerstown"/>
<Hex name="B7" tile="0"/>
<Hex name="C4" tile="0"/>
- <Hex name="C6" tile="-10" city="Harper's Ferry" impassable="D7"/>
+ <Hex name="C6" tile="-10" city="Harper's Ferry" impassable="D5,E6"/>
<Hex name="C8" tile="-10" city="Baltimore" label="P"/>
<Hex name="D3" tile="-10" city="Cumberland"/>
<Hex name="D5" tile="0"/>
@@ -36,11 +36,11 @@
<Hex name="L1" tile="-1922" city="Roanoke"/>
<Hex name="L3" tile="-10" city="Lynchburg"/>
<Hex name="L5" tile="0"/>
- <Hex name="L7" tile="0" impassable="M6"/>
+ <Hex name="L7" tile="0" impassable="M6,N7"/>
<Hex name="M2" tile="-1"/>
<Hex name="M4" tile="0"/>
<Hex name="M6" tile="-10" city="Petersburg" label="P"/>
- <Hex name="M8" tile="57" city="Newport News" impassable="N7"/>
+ <Hex name="M8" tile="57" orientation="2" city="Newport News" impassable="N7,O8"/>
<Hex name="N3" tile="0"/>
<Hex name="N5" tile="0"/>
<Hex name="N7" tile="0"/>
Modified: trunk/18xx/rails/game/MapManager.java
===================================================================
--- trunk/18xx/rails/game/MapManager.java 2011-03-14 15:52:15 UTC (rev 1497)
+++ trunk/18xx/rails/game/MapManager.java 2011-03-14 21:18:55 UTC (rev 1498)
@@ -135,7 +135,7 @@
if (ii >= minX && ii <= maxX && jj >= minY && jj <= maxY
&& (nb = hexes[ii][jj]) != null) {
if (hex.isNeighbour(nb, k)
- && nb.isNeighbour(hex, k + 3)) {
+ && nb.isNeighbour(hex, k + 3)) {
hex.setNeighbor(k, nb);
nb.setNeighbor(k + 3, hex);
}
Modified: trunk/18xx/rails/ui/swing/hexmap/GUIHex.java
===================================================================
--- trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2011-03-14 15:52:15 UTC (rev 1497)
+++ trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2011-03-14 21:18:55 UTC (rev 1498)
@@ -114,7 +114,15 @@
tokenDiameter = (int)Math.round(NORMAL_TOKEN_SIZE * zoomFactor);
if (hexMap.getMapManager().getTileOrientation() == MapHex.EW) {
-// len = scale;
+ /* The numbering is unusual:
+ * 0
+ * / \
+ * 5 1
+ * | |
+ * 4 2
+ * \ /
+ * 3
+ */
xVertex[0] = cx + SQRT3 * scale;
yVertex[0] = cy + scale;
xVertex[1] = cx + 2 * SQRT3 * scale;
@@ -130,7 +138,13 @@
baseRotation = 30; // degrees
} else {
-// len = scale / 3.0;
+ /* The numbering is unusual:
+ * 4--3
+ * / \
+ * 5 2
+ * \ /
+ * 0--1
+ */
xVertex[0] = cx;
yVertex[0] = cy;
xVertex[1] = cx + 2 * scale;
@@ -230,10 +244,14 @@
}
public void addBar (int orientation) {
+ // NOTE: orientation here is its normal value in Rails + 3 (mod 6).
orientation %= 6;
if (barStartPoints == null) barStartPoints = new ArrayList<Integer>(2);
- int offset = hexMap.getMapManager().getTileOrientation() == MapHex.EW ? 0 : 4;
- barStartPoints.add((offset+5-orientation)%6);
+ if (hexMap.getMapManager().getTileOrientation() == MapHex.EW) {
+ barStartPoints.add((5-orientation)%6);
+ } else {
+ barStartPoints.add((3+orientation)%6);
+ }
}
public Rectangle getBounds() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-14 15:52:22
|
Revision: 1497
http://rails.svn.sourceforge.net/rails/?rev=1497&view=rev
Author: evos
Date: 2011-03-14 15:52:15 +0000 (Mon, 14 Mar 2011)
Log Message:
-----------
18VA XML files (first version)
Modified Paths:
--------------
trunk/18xx/data/GamesList.xml
Added Paths:
-----------
trunk/18xx/data/18VA/
trunk/18xx/data/18VA/CompanyManager.xml
trunk/18xx/data/18VA/Game.xml
trunk/18xx/data/18VA/Map.xml
trunk/18xx/data/18VA/StockMarket.xml
trunk/18xx/data/18VA/TileSet.xml
trunk/18xx/data/18VA/Tiles.xml
Added: trunk/18xx/data/18VA/CompanyManager.xml
===================================================================
--- trunk/18xx/data/18VA/CompanyManager.xml (rev 0)
+++ trunk/18xx/data/18VA/CompanyManager.xml 2011-03-14 15:52:15 UTC (rev 1497)
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<CompanyManager>
+ <CompanyType name="Private" class="rails.game.PrivateCompany">
+ <ClosingConditions>
+ <Phase>5</Phase>
+ </ClosingConditions>
+ </CompanyType>
+ <CompanyType name="Public" class="rails.game.PublicCompany">
+ <CanBuyPrivates lowerPriceFactor="0.5" upperPriceFactor="2.0"/>
+ <PoolPaysOut/>
+ <Float percentage="60"/>
+ <ShareUnit percentage="10"/>
+ <BaseTokens>
+ <!-- HomeBase lay options: "whenStarted", "whenFloated", "firstOR" (default) -->
+ <HomeBase lay="firstOR"/>
+ <!-- LayCost methods: only "sequence" (1830 style) implemented so far (default) -->
+ <LayCost method="sequence" cost="0,40,100"/>
+ </BaseTokens>
+ <Certificate type="President" shares="2"/>
+ <Certificate shares="1" number="8"/>
+ <Trains number="4,4,3,2"/>
+ <CanUseSpecialProperties/>
+ </CompanyType>
+
+ <Company name="REA" type="Private" basePrice="40" revenue="10"
+ longname="Railway Express Agency">
+ </Company>
+ <Company name="TIW" type="Private" basePrice="60" revenue="15"
+ longname="Tredegar Iron Works">
+ </Company>
+ <Company name="PY" type="Private" basePrice="80" revenue="20"
+ longname="Potomac Yards">
+ </Company>
+ <Company name="B&O" type="Private" basePrice="140" revenue="0"
+ longname="Baltimore and Ohio President's Certificate">
+ </Company>
+
+ <!-- Note two supported colour specification formats:
+ RGB decimal with commas and RGB hexadecimal without commas -->
+ <Company name="B&O" type="Public" tokens="4" fgColour="FFFFFF" bgColour="0000FF"
+ longname="Baltimore and Ohio Railroad">
+ <Home hex="C8"/>
+ </Company>
+ <Company name="C&O" type="Public" tokens="4" fgColour="000000" bgColour="00CCFF"
+ longname="Chesapeake and Ohio Railway">
+ <Home hex="I4"/>
+ </Company>
+ <Company name="NW" type="Public" tokens="4" fgColour="FFFFFF" bgColour="000000"
+ longname="Norfolk and Western Railway">
+ <Home hex="M6"/>
+ </Company>
+ <Company name="RFP" type="Public" tokens="4" fgColour="FFFFFF" bgColour="FF0000"
+ longname="Richmond, Fredericksburg, and Potomac Railroad">
+ <Home hex="G6"/>
+ </Company>
+ <Company name="SR" type="Public" tokens="4" fgColour="FFFFFF" bgColour="006600"
+ longname="Southern Railway">
+ <Home hex="K6"/>
+ </Company>
+ <Company name="VGN" type="Public" tokens="4" fgColour="FFFFFF" bgColour="990066"
+ longname="Virginian Railway">
+ <Home hex="L3"/>
+ </Company>
+ <Company name="WM" type="Public" tokens="4" fgColour="FFFFFF" bgColour="FF9900"
+ longname="Western Maryland Railway">
+ <Home hex="D3"/>
+ </Company>
+ <StartPacket roundClass="rails.game.StartRound_1830">
+ <Bidding initial="5" minimum="5" increment="1"/>
+ <Item name="REA" type="Private" basePrice="40"/>
+ <Item name="TIW" type="Private" basePrice="60"/>
+ <Item name="PY" type="Private" basePrice="80"/>
+ <Item name="B&O" type="Private" basePrice="140"/>
+ </StartPacket>
+</CompanyManager>
Property changes on: trunk/18xx/data/18VA/CompanyManager.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18VA/Game.xml
===================================================================
--- trunk/18xx/data/18VA/Game.xml (rev 0)
+++ trunk/18xx/data/18VA/Game.xml 2011-03-14 15:52:15 UTC (rev 1497)
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<ComponentManager>
+ <Component name="GameManager" class="rails.game.GameManager">
+ <Game name="1830"/>
+ <!-- GAME OPTIONS must have:
+ - a name, which must also exist as an entry in LocalText.properties,
+ - optionally 'type="toggle"', which has the effect that the
+ selection uses a checkbox instead of a dropdown list.
+ In this case, 'values' must be absent
+ (the allowed values are fixed to "yes,no").
+ - optionally, 'values="a,b,c"' i,e, a list of allowed values.
+ - optionally, a default value (only affects a toggle;
+ in a dropdown the first item is always the default).
+ -->
+ <!-- The options in Game.xml are not currently used.
+ See GamesList.xml for the real ones.
+ -->
+ <GameOption name="Variant" values="Basegame,Pere Marquette" default="Basegame" />
+ <GameParameters>
+ <PlayerShareLimit percentage="60">
+ <!-- Option "NumberOfPlayers" is automatically set
+ by the game engine -->
+ <IfOption name="NumberOfPlayers" value="2">
+ <IfOption name="TwoPlayersCertLimit70Percent" value="yes">
+ <Attributes percentage="70"/>
+ </IfOption>
+ </IfOption>
+ </PlayerShareLimit>
+ <BankPoolLimit percentage="50"/>
+ <StockRound>
+ <NoSaleInFirstSR/>
+ </StockRound>
+ </GameParameters>
+ <EndOfGame>
+ <Bankruptcy/>
+ <BankBreaks limit="0" finish="setOfORs"/>
+ <!-- "Runs out"; when "broken", -1 is the limit -->
+ </EndOfGame>
+ </Component>
+ <Component name="PlayerManager" class="rails.game.PlayerManager">
+ <IfOption name="Variant" value="Basegame">
+ <Players number="2" cash="600" certLimit="27"/>
+ <Players number="3" cash="400" certLimit="18"/>
+ <Players number="4" cash="300" certLimit="13"/>
+ <Players number="5" cash="240" certLimit="10"/>
+ </IfOption>
+ </Component>
+ <Component name="Bank" class="rails.game.Bank">
+ <Bank amount="8000"/>
+ <Money format="$@"/>
+ </Component>
+ <Component name="TileManager" class="rails.game.TileManager"
+ file="TileSet.xml"/>
+ <Component name="Map" class="rails.game.MapManager" file="Map.xml"/>
+ <Component name="CompanyManager" class="rails.game.CompanyManager"
+ file="CompanyManager.xml"/>
+ <Component name="StockMarket" class="rails.game.StockMarket"
+ file="StockMarket.xml"/>
+ <Component name="TrainManager" class="rails.game.TrainManager">
+ <Defaults>
+ <Reach base="stops" countTowns="no"/>
+ <!-- Alternative values:
+ base="hexes" for H-trains as in 1826, 1849 etc.
+ countTowns="no" for all trains in 1841, 18EU, etc.,
+ where towns score but do not count against the train length.
+ Otherwise, towns are counted as minor or major stops,
+ depending on the presence or absence of a "minorStops" value.
+ -->
+ <Score towns="yes"/>
+ <!-- Alternative values:
+ towns="no" for trains that ignore towns (e.g. 1826 TGV).
+ cities="double" if city-revenue is doubled (e.g. 1826 TGV).
+ -->
+ </Defaults>
+ <Train name="2" majorStops="2" cost="100" amount="6"/>
+ <Train name="3" majorStops="3" cost="200" amount="5" startPhase="3"/>
+ <Train name="4" majorStops="4" cost="300" amount="4" startPhase="4"
+ rustedTrain="2"/>
+ <Train name="5" majorStops="5" cost="500" amount="3" startPhase="5"
+ rustedTrain="3"/>
+ <Train name="6" majorStops="6" cost="600" startPhase="6"
+ releasedTrain="4D">
+ </Train>
+ <Train name="4D" majorStops="99" cost="800" amount="10" startPhase="4D"
+ rustedTrain="4">
+ </Train>
+ </Component>
+ <Component name="PhaseManager" class="rails.game.PhaseManager">
+ <!-- Note: released and rusted trains are now specified per Train
+ but could as well be moved here. To be sorted out when we do 18US. -->
+ <!-- Each Phase's defaults are the previous one's values -->
+ <Phase name="2" >
+ <Tiles colour="yellow"/>
+ <Privates sellingAllowed="no"/>
+ <OperatingRounds number="1"/>
+ <Trains tradingAllowed="yes"/>
+ </Phase>
+ <Phase name="3">
+ <Tiles colour="yellow,green"/>
+ <Privates sellingAllowed="yes"/>
+ <OperatingRounds number="2"/>
+ </Phase>
+ <Phase name="4">
+ <Tiles colour="yellow,green"/>
+ </Phase>
+ <Phase name="5">
+ <Tiles colour="yellow,green,brown"/>
+ <!--Privates close="yes"/-->
+ <OperatingRounds number="3"/>
+ <OffBoardRevenue step="2"/>
+ </Phase>
+ <Phase name="6">
+ <Tiles colour="yellow,green,brown"/>
+ </Phase>
+ <Phase name="4D">
+ <Tiles colour="yellow,green,brown"/>
+ </Phase>
+ </Component>
+</ComponentManager>
\ No newline at end of file
Property changes on: trunk/18xx/data/18VA/Game.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18VA/Map.xml
===================================================================
--- trunk/18xx/data/18VA/Map.xml (rev 0)
+++ trunk/18xx/data/18VA/Map.xml 2011-03-14 15:52:15 UTC (rev 1497)
@@ -0,0 +1,54 @@
+<Map mapClass="rails.ui.swing.hexmap.NSHexMap" tileOrientation="NS" letterOrientation="vertical" even="A">
+ <Hex name="A6" tile="0"/>
+ <Hex name="A8" tile="-1921" orientation="1" value="40,70" city="Philadelphia"/>
+ <Hex name="B5" tile="-10" city="Hagerstown"/>
+ <Hex name="B7" tile="0"/>
+ <Hex name="C4" tile="0"/>
+ <Hex name="C6" tile="-10" city="Harper's Ferry" impassable="D7"/>
+ <Hex name="C8" tile="-10" city="Baltimore" label="P"/>
+ <Hex name="D3" tile="-10" city="Cumberland"/>
+ <Hex name="D5" tile="0"/>
+ <Hex name="D7" tile="-10" city="Washington" label="P"/>
+ <Hex name="D9" tile="-4001" orientation="3" value="30,20"/>
+ <Hex name="E2" tile="-1"/>
+ <Hex name="E4" tile="0"/>
+ <Hex name="E6" tile="-10" city="Alexandria" label="P"/>
+ <Hex name="E8" tile="57" city="Annapolis" orientation="2" impassable="F7"/>
+ <Hex name="F1" tile="-1922" city="Grafton"/>
+ <Hex name="F3" tile="0"/>
+ <Hex name="F5" tile="0"/>
+ <Hex name="F7" tile="0" impassable="G6"/>
+ <Hex name="F9" tile="-4001" orientation="3" value="20,10"/>
+ <Hex name="G2" tile="-1"/>
+ <Hex name="G4" tile="0"/>
+ <Hex name="G6" tile="-10" city="Fredericksburg"/>
+ <Hex name="H3" tile="-10" city="Staunton"/>
+ <Hex name="H5" tile="-10" city="Gordonsville"/>
+ <Hex name="I2" tile="-1"/>
+ <Hex name="I4" tile="-10" city="Charlottesville"/>
+ <Hex name="I6" tile="0"/>
+ <Hex name="J3" tile="0"/>
+ <Hex name="J5" tile="0"/>
+ <Hex name="J7" tile="0"/>
+ <Hex name="K2" tile="-1"/>
+ <Hex name="K4" tile="0"/>
+ <Hex name="K6" tile="-10" city="Richmond" label="P"/>
+ <Hex name="L1" tile="-1922" city="Roanoke"/>
+ <Hex name="L3" tile="-10" city="Lynchburg"/>
+ <Hex name="L5" tile="0"/>
+ <Hex name="L7" tile="0" impassable="M6"/>
+ <Hex name="M2" tile="-1"/>
+ <Hex name="M4" tile="0"/>
+ <Hex name="M6" tile="-10" city="Petersburg" label="P"/>
+ <Hex name="M8" tile="57" city="Newport News" impassable="N7"/>
+ <Hex name="N3" tile="0"/>
+ <Hex name="N5" tile="0"/>
+ <Hex name="N7" tile="0"/>
+ <Hex name="N9" tile="-4001" orientation="3" value="20,40"/>
+ <Hex name="O2" tile="-1911" orientation="5" value="20,40" city="Greensboro"/>
+ <Hex name="O4" tile="0"/>
+ <Hex name="O6" tile="0"/>
+ <Hex name="O8" tile="57" city="Norfolk" orientation="2"/>
+ <Hex name="P9" tile="-4001" orientation="3" value="30,50"/>
+ <Hex name="Q6" tile="-1911" orientation="4" value="30,50" city="Rocky Mount"/>
+</Map>
Property changes on: trunk/18xx/data/18VA/Map.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18VA/StockMarket.xml
===================================================================
--- trunk/18xx/data/18VA/StockMarket.xml (rev 0)
+++ trunk/18xx/data/18VA/StockMarket.xml 2011-03-14 15:52:15 UTC (rev 1497)
@@ -0,0 +1,80 @@
+<StockMarket type="rectangular">
+ <!-- Note two supported colour specification formats:
+ RGB decimal with commas and RGB hexadecimal without commas -->
+
+ <StockSpace name="A1" price="82"/>
+ <StockSpace name="A2" price="75"/>
+ <StockSpace name="A3" price="70"/>
+ <StockSpace name="A4" price="65"/>
+ <StockSpace name="A5" price="60"/>
+ <StockSpace name="A6" price="50"/>
+ <StockSpace name="A7" price="40"/>
+ <StockSpace name="B1" price="90"/>
+ <StockSpace name="B2" price="82"/>
+ <StockSpace name="B3" price="75"/>
+ <StockSpace name="B4" price="70"/>
+ <StockSpace name="B5" price="65"/>
+ <StockSpace name="B6" price="60"/>
+ <StockSpace name="B7" price="50"/>
+ <StockSpace name="C1" price="100"/>
+ <StockSpace name="C2" price="90"/>
+ <StockSpace name="C3" price="82"/>
+ <StockSpace name="C4" price="75"/>
+ <StockSpace name="C5" price="70">
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="C6" price="65"/>
+ <StockSpace name="C7" price="60"/>
+ <StockSpace name="D1" price="110"/>
+ <StockSpace name="D2" price="100"/>
+ <StockSpace name="D3" price="90"/>
+ <StockSpace name="D4" price="82">
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="D5" price="75">
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="D6" price="70"/>
+ <StockSpace name="D7" price="65"/>
+ <StockSpace name="E1" price="122"/>
+ <StockSpace name="E2" price="110"/>
+ <StockSpace name="E3" price="100">
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="E4" price="90">
+ <StartSpace/>
+ </StockSpace>
+ <StockSpace name="E5" price="82"/>
+ <StockSpace name="E6" price="75"/>
+ <StockSpace name="F1" price="135"/>
+ <StockSpace name="F2" price="122"/>
+ <StockSpace name="F3" price="110"/>
+ <StockSpace name="F4" price="100"/>
+ <StockSpace name="F5" price="90"/>
+ <StockSpace name="G1" price="150"/>
+ <StockSpace name="G2" price="135"/>
+ <StockSpace name="G3" price="122"/>
+ <StockSpace name="G4" price="110"/>
+ <StockSpace name="H1" price="165"/>
+ <StockSpace name="H2" price="150"/>
+ <StockSpace name="H3" price="135"/>
+ <StockSpace name="H4" price="122"/>
+ <StockSpace name="I1" price="180"/>
+ <StockSpace name="I2" price="165"/>
+ <StockSpace name="I3" price="150"/>
+ <StockSpace name="J1" price="200"/>
+ <StockSpace name="J2" price="180"/>
+ <StockSpace name="J3" price="165"/>
+ <StockSpace name="K1" price="220"/>
+ <StockSpace name="K2" price="200"/>
+ <StockSpace name="K3" price="180"/>
+ <StockSpace name="L1" price="245"/>
+ <StockSpace name="L2" price="220"/>
+ <StockSpace name="M1" price="270"/>
+ <StockSpace name="M2" price="245"/>
+ <StockSpace name="N1" price="300"/>
+ <StockSpace name="N2" price="270"/>
+ <StockSpace name="O1" price="330"/>
+ <StockSpace name="P1" price="360"/>
+ <StockSpace name="Q1" price="400"/>
+</StockMarket>
Property changes on: trunk/18xx/data/18VA/StockMarket.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18VA/TileSet.xml
===================================================================
--- trunk/18xx/data/18VA/TileSet.xml (rev 0)
+++ trunk/18xx/data/18VA/TileSet.xml 2011-03-14 15:52:15 UTC (rev 1497)
@@ -0,0 +1,134 @@
+<TileManager tiles="Tiles.xml">
+ <!-- Preprinted tiles -->
+ <Tile id="0"><!-- Empty space -->
+ <Upgrade id="7,8,9"/>
+ </Tile>
+ <Tile id="-1"><!-- 1 town -->
+ <Upgrade id="3,4,58"/>
+ </Tile>
+ <Tile id="-2"><!-- 2 towns -->
+ <Upgrade id="1,2,55,56,69"/>
+ </Tile>
+ <Tile id="-3"/>
+ <Tile id="-5"/>
+ <Tile id="-7"/>
+ <Tile id="-10"><!-- 1 city -->
+ <Upgrade id="57"/>
+ </Tile>
+ <Tile id="-11"><!-- B yellow -->
+ <Upgrade id="53"/>
+ </Tile>
+ <Tile id="-20"><!-- 2 OO cities -->
+ <Upgrade id="59" relayBaseTokens="yes"/>
+ </Tile>
+ <Tile id="-21"><!-- New York -->
+ <Upgrade id="54"/>
+ </Tile>
+ <Tile id="-58"/>
+ <Tile id="-101"/><!-- Altoona -->
+ <Tile id="-102"/><!-- Rochester -->
+ <Tile id="-103"/><!-- Montreal -->
+ <Tile id="-104"/><!-- Norwich -->
+ <Tile id="-105"/><!-- Cleveland -->
+ <Tile id="-901"/>
+ <Tile id="-902"/>
+ <Tile id="-903"/>
+ <Tile id="-1911"/>
+ <Tile id="-1921"/>
+ <Tile id="-1922"/>
+ <Tile id="-4001"/>
+
+ <!-- Yellow tiles -->
+ <Tile id="1" quantity="1" />
+ <Tile id="2" quantity="1" />
+ <Tile id="3" quantity="2" />
+ <Tile id="4" quantity="2" />
+ <Tile id="7" quantity="4">
+ <Upgrade id="18,26,27,28,29" />
+ </Tile>
+ <Tile id="8" quantity="8">
+ <Upgrade id="16,19,23,24,25,28,29" />
+ </Tile>
+ <Tile id="9" quantity="7">
+ <Upgrade id="18,19,20,23,24,26,27" />
+ </Tile>
+ <Tile id="55" quantity="1" />
+ <Tile id="56" quantity="1" />
+ <Tile id="57" quantity="4">
+ <Upgrade id="14,15" />
+ </Tile>
+ <Tile id="58" quantity="2" />
+ <Tile id="69" quantity="1" />
+
+ <!-- Green tiles -->
+ <Tile id="14" quantity="3">
+ <Upgrade id="63" />
+ </Tile>
+ <Tile id="15" quantity="2">
+ <Upgrade id="63" />
+ </Tile>
+ <Tile id="16" quantity="1">
+ <Upgrade id="43,70" />
+ </Tile>
+ <Tile id="18" quantity="1">
+ <Upgrade id="43" />
+ </Tile>
+ <Tile id="19" quantity="1">
+ <Upgrade id="45,46" />
+ </Tile>
+ <Tile id="20" quantity="1">
+ <Upgrade id="44,47" />
+ </Tile>
+ <Tile id="23" quantity="3">
+ <Upgrade id="41,43,45,47" />
+ </Tile>
+ <Tile id="24" quantity="3">
+ <Upgrade id="42,43,46,47" />
+ </Tile>
+ <Tile id="25" quantity="1">
+ <Upgrade id="40,45,46" />
+ </Tile>
+ <Tile id="26" quantity="1">
+ <Upgrade id="42,44,45" />
+ </Tile>
+ <Tile id="27" quantity="1">
+ <Upgrade id="41,44,46" />
+ </Tile>
+ <Tile id="28" quantity="1">
+ <Upgrade id="39,43,46,70" />
+ </Tile>
+ <Tile id="29" quantity="1">
+ <Upgrade id="39,43,45,70" />
+ </Tile>
+ <Tile id="53" quantity="2">
+ <Upgrade id="61" />
+ </Tile>
+ <Tile id="54" quantity="1">
+ <Upgrade id="62" />
+ </Tile>
+ <Tile id="59" quantity="2">
+ <Upgrade id="64,65,66,67,68" />
+ </Tile>
+ <!-- Brown tiles -->
+ <Tile id="39" quantity="1" />
+ <Tile id="40" quantity="1" />
+ <Tile id="41" quantity="2" />
+ <Tile id="42" quantity="2" />
+ <Tile id="43" quantity="2" />
+ <Tile id="44" quantity="1" />
+ <Tile id="45" quantity="2" />
+ <Tile id="46" quantity="2" />
+ <Tile id="47" quantity="1" />
+ <Tile id="61" quantity="2" />
+ <Tile id="62" quantity="1" />
+ <Tile id="63" quantity="3" />
+ <Tile id="64" quantity="1" />
+ <Tile id="65" quantity="1" />
+ <Tile id="66" quantity="1" />
+ <Tile id="67" quantity="1" />
+ <Tile id="68" quantity="1" />
+ <Tile id="70" quantity="1" />
+
+ <Tile id="-800"/>
+
+</TileManager>
Property changes on: trunk/18xx/data/18VA/TileSet.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/18xx/data/18VA/Tiles.xml
===================================================================
--- trunk/18xx/data/18VA/Tiles.xml (rev 0)
+++ trunk/18xx/data/18VA/Tiles.xml 2011-03-14 15:52:15 UTC (rev 1497)
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><Tiles><Tile colour="white" id="0" name="empty"/><Tile colour="white" id="-1" name="1 village">
+ <Station id="city1" position="002" type="Town"/>
+ </Tile><Tile colour="white" id="-2" name="2 villages">
+ <Station id="city1" position="102" type="Town"/>
+ <Station id="city2" position="302" type="Town"/>
+ </Tile><Tile colour="fixed" id="-3" name="MF 3">
+ <Station id="city1" position="352" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ </Tile><Tile colour="fixed" id="-5" name="MF 5">
+ <Station id="city1" position="0" slots="1" type="City" value="20"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ </Tile><Tile colour="fixed" id="-7" name="MF 7">
+ <Track from="side2" gauge="normal" to="side1"/>
+ </Tile><Tile colour="white" id="-10" name="1 city">
+ <Station id="city1" position="302" slots="1" type="City"/>
+ </Tile><Tile colour="yellow" id="-11" name="B">
+ <Station id="city1" position="0" slots="1" type="City" value="30"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ </Tile><Tile colour="yellow" id="-20" name="2 cities">
+ <Station id="city1" position="002" slots="1" type="City"/>
+ <Station id="city2" position="302" slots="1" type="City"/>
+ </Tile><Tile colour="yellow" id="-21" name="NY">
+ <Station id="city1" position="202" slots="1" type="City" value="40"/>
+ <Station id="city2" position="502" slots="1" type="City" value="40"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city2" gauge="normal" to="side5"/>
+ </Tile><Tile colour="fixed" id="-58" name="MF 58">
+ <Station id="city1" position="301" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ </Tile><Tile colour="fixed" id="-101" name="Philadelphia">
+ <Station id="city1" position="0" slots="1" type="City" value="10"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="side4" gauge="normal" to="side1"/>
+ </Tile><Tile colour="fixed" id="-102" name="-102">
+ <Station id="city1" position="351" slots="1" type="City" value="20"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ </Tile><Tile colour="fixed" id="-103" name="MF 103">
+ <Station id="city1" position="0" slots="1" type="City" value="40"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ </Tile><Tile colour="fixed" id="-104" name="MF 104">
+ <Station id="city1" position="0" slots="1" type="City" value="20"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ </Tile><Tile colour="fixed" id="-105" name="MF 105">
+ <Station id="city1" position="0" slots="1" type="City" value="30"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ </Tile><Tile colour="red" id="-901" name="OM 1 way">
+ <Station id="city1" position="0" type="OffMapCity" value="-1"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ </Tile><Tile colour="red" id="-902" name="OM 2 way">
+ <Station id="city1" position="0" type="OffMapCity" value="-1"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ </Tile><Tile colour="red" id="-903" name="OM 3 way">
+ <Station id="city1" position="0" type="OffMapCity" value="-1"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ </Tile><Tile colour="red" id="-1911" name="OM1Slot-1">
+ <Station id="city1" position="0" slots="1" type="OffMapCity"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ </Tile><Tile colour="red" id="-1921" name="OM2Slot-1">
+ <Station id="city1" position="0" slots="2" type="OffMapCity"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ </Tile><Tile colour="red" id="-1922" name="OM2Slot-2">
+ <Station id="city1" position="0" slots="2" type="OffMapCity"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ </Tile><Tile colour="red" id="-4001" name="Port-1">
+ <Station id="city1" position="0" type="OffMapCity"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ </Tile><Tile colour="yellow" id="1" name="1">
+ <Station id="city1" position="408" type="Town" value="10"/>
+ <Station id="city2" position="108" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city2" gauge="normal" to="side1"/>
+ <Track from="city2" gauge="normal" to="side3"/>
+ </Tile><Tile colour="yellow" id="2" name="2">
+ <Station id="city1" position="302" type="Town" value="10"/>
+ <Station id="city2" position="109" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ <Track from="city2" gauge="normal" to="side1"/>
+ <Track from="city2" gauge="normal" to="side2"/>
+ </Tile><Tile colour="yellow" id="3" name="3">
+ <Station id="city1" position="452" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ </Tile><Tile colour="yellow" id="4" name="4">
+ <Station id="city1" position="0" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ </Tile><Tile colour="yellow" id="7" name="7">
+ <Track from="side3" gauge="normal" to="side4"/>
+ </Tile><Tile colour="yellow" id="8" name="8">
+ <Track from="side3" gauge="normal" to="side5"/>
+ </Tile><Tile colour="yellow" id="9" name="9">
+ <Track from="side3" gauge="normal" to="side0"/>
+ </Tile><Tile colour="yellow" id="55" name="55">
+ <Station id="city1" position="202" type="Town" value="10"/>
+ <Station id="city2" position="302" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side5"/>
+ <Track from="city2" gauge="normal" to="side3"/>
+ <Track from="city2" gauge="normal" to="side0"/>
+ </Tile><Tile colour="yellow" id="56" name="56">
+ <Station id="city1" position="407" type="Town" value="10"/>
+ <Station id="city2" position="108" type="Town" value="10"/>
+ <Track from="city2" gauge="normal" to="side1"/>
+ <Track from="city2" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ </Tile><Tile colour="yellow" id="57" name="57">
+ <Station id="city1" position="0" slots="1" type="City" value="20"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ </Tile><Tile colour="yellow" id="58" name="58">
+ <Station id="city1" position="401" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side5"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ </Tile><Tile colour="yellow" id="69" name="69">
+ <Station id="city1" position="407" type="Town" value="10"/>
+ <Station id="city2" position="002" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city2" gauge="normal" to="side0"/>
+ <Track from="city2" gauge="normal" to="side3"/>
+ </Tile><Tile colour="green" id="14" name="14">
+ <Station id="city1" position="0" slots="2" type="City" value="30"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ </Tile><Tile colour="green" id="15" name="15">
+ <Station id="city1" position="0" slots="2" type="City" value="30"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city1" gauge="normal" to="side5"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ </Tile><Tile colour="green" id="16" name="16">
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side4" gauge="normal" to="side0"/>
+ </Tile><Tile colour="green" id="18" name="18">
+ <Track from="side3" gauge="normal" to="side0"/>
+ <Track from="side4" gauge="normal" to="side5"/>
+ </Tile><Tile colour="green" id="19" name="19">
+ <Track from="side5" gauge="normal" to="side1"/>
+ <Track from="side0" gauge="normal" to="side3"/>
+ </Tile><Tile colour="green" id="20" name="20">
+ <Track from="side1" gauge="normal" to="side4"/>
+ <Track from="side3" gauge="normal" to="side0"/>
+ </Tile><Tile colour="green" id="23" name="23">
+ <Track from="side4" gauge="normal" to="side0"/>
+ <Track from="side0" gauge="normal" to="side3"/>
+ </Tile><Tile colour="green" id="24" name="24">
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side3" gauge="normal" to="side0"/>
+ </Tile><Tile colour="green" id="25" name="25">
+ <Track from="side1" gauge="normal" to="side3"/>
+ <Track from="side3" gauge="normal" to="side5"/>
+ </Tile><Tile colour="green" id="26" name="26">
+ <Track from="side5" gauge="normal" to="side0"/>
+ <Track from="side0" gauge="normal" to="side3"/>
+ </Tile><Tile colour="green" id="27" name="27">
+ <Track from="side3" gauge="normal" to="side4"/>
+ <Track from="side3" gauge="normal" to="side0"/>
+ </Tile><Tile colour="green" id="28" name="28">
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side4" gauge="normal" to="side5"/>
+ </Tile><Tile colour="green" id="29" name="29">
+ <Track from="side3" gauge="normal" to="side4"/>
+ <Track from="side3" gauge="normal" to="side5"/>
+ </Tile><Tile colour="green" id="53" name="53">
+ <Station id="city1" position="0" slots="1" type="City" value="50"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side5"/>
+ </Tile><Tile colour="green" id="54" name="54">
+ <Station id="city1" position="452" slots="1" type="City" value="60"/>
+ <Station id="city2" position="052" slots="1" type="City" value="60"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city2" gauge="normal" to="side5"/>
+ <Track from="city2" gauge="normal" to="side0"/>
+ </Tile><Tile colour="green" id="59" name="59">
+ <Station id="city1" position="152" slots="1" type="City" value="40"/>
+ <Station id="city2" position="452" slots="1" type="City" value="40"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city2" gauge="normal" to="side3"/>
+ </Tile><Tile colour="brown" id="39" name="39">
+ <Track from="side3" gauge="normal" to="side4"/>
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side4" gauge="normal" to="side5"/>
+ </Tile><Tile colour="brown" id="40" name="40">
+ <Track from="side1" gauge="normal" to="side3"/>
+ <Track from="side1" gauge="normal" to="side5"/>
+ <Track from="side3" gauge="normal" to="side5"/>
+ </Tile><Tile colour="brown" id="41" name="41">
+ <Track from="side4" gauge="normal" to="side0"/>
+ <Track from="side4" gauge="normal" to="side3"/>
+ <Track from="side0" gauge="normal" to="side3"/>
+ </Tile><Tile colour="brown" id="42" name="42">
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side3" gauge="normal" to="side0"/>
+ <Track from="side5" gauge="normal" to="side0"/>
+ </Tile><Tile colour="brown" id="43" name="43">
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side3" gauge="normal" to="side0"/>
+ <Track from="side4" gauge="normal" to="side5"/>
+ <Track from="side4" gauge="normal" to="side0"/>
+ </Tile><Tile colour="brown" id="44" name="44">
+ <Track from="side3" gauge="normal" to="side0"/>
+ <Track from="side1" gauge="normal" to="side0"/>
+ <Track from="side3" gauge="normal" to="side4"/>
+ <Track from="side1" gauge="normal" to="side4"/>
+ </Tile><Tile colour="brown" id="45" name="45">
+ <Track from="side1" gauge="normal" to="side5"/>
+ <Track from="side1" gauge="normal" to="side3"/>
+ <Track from="side5" gauge="normal" to="side0"/>
+ <Track from="side3" gauge="normal" to="side0"/>
+ </Tile><Tile colour="brown" id="46" name="46">
+ <Track from="side1" gauge="normal" to="side5"/>
+ <Track from="side1" gauge="normal" to="side0"/>
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side3" gauge="normal" to="side0"/>
+ </Tile><Tile colour="brown" id="47" name="47">
+ <Track from="side3" gauge="normal" to="side0"/>
+ <Track from="side3" gauge="normal" to="side1"/>
+ <Track from="side4" gauge="normal" to="side0"/>
+ <Track from="side4" gauge="normal" to="side1"/>
+ </Tile><Tile colour="brown" id="61" name="61">
+ <Station id="city1" position="0" slots="1" type="City" value="60"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side5"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ </Tile><Tile colour="brown" id="62" name="62">
+ <Station id="city1" position="302" slots="2" type="City" value="80"/>
+ <Station id="city2" position="002" slots="2" type="City" value="80"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city2" gauge="normal" to="side5"/>
+ <Track from="city2" gauge="normal" to="side0"/>
+ </Tile><Tile colour="brown" id="63" name="63">
+ <Station id="city1" position="0" slots="2" type="City" value="40"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side2"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city1" gauge="normal" to="side5"/>
+ </Tile><Tile colour="brown" id="64" name="64">
+ <Station id="city1" position="401" slots="1" type="City" value="50"/>
+ <Station id="city2" position="152" slots="1" type="City" value="50"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side5"/>
+ <Track from="city2" gauge="normal" to="side1"/>
+ <Track from="city2" gauge="normal" to="side0"/>
+ </Tile><Tile colour="brown" id="65" name="65">
+ <Station id="city1" position="501" slots="1" type="City" value="50"/>
+ <Station id="city2" position="352" slots="1" type="City" value="50"/>
+ <Track from="city1" gauge="normal" to="side4"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ <Track from="city2" gauge="normal" to="side2"/>
+ <Track from="city2" gauge="normal" to="side3"/>
+ </Tile><Tile colour="brown" id="66" name="66">
+ <Station id="city1" position="002" slots="1" type="City" value="50"/>
+ <Station id="city2" position="552" slots="1" type="City" value="50"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ <Track from="city2" gauge="normal" to="side4"/>
+ <Track from="city2" gauge="normal" to="side5"/>
+ </Tile><Tile colour="brown" id="67" name="67">
+ <Station id="city1" position="307" slots="1" type="City" value="50"/>
+ <Station id="city2" position="502" slots="1" type="City" value="50"/>
+ <Track from="city1" gauge="normal" to="side1"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city2" gauge="normal" to="side5"/>
+ <Track from="city2" gauge="normal" to="side2"/>
+ </Tile><Tile colour="brown" id="68" name="68">
+ <Station id="city1" position="302" slots="1" type="City" value="50"/>
+ <Station id="city2" position="502" slots="1" type="City" value="50"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ <Track from="city2" gauge="normal" to="side2"/>
+ <Track from="city2" gauge="normal" to="side5"/>
+ <Track from="city1" gauge="normal" to="side0"/>
+ </Tile><Tile colour="brown" id="70" name="70">
+ <Track from="side3" gauge="normal" to="side5"/>
+ <Track from="side3" gauge="normal" to="side4"/>
+ <Track from="side5" gauge="normal" to="side0"/>
+ <Track from="side4" gauge="normal" to="side0"/>
+ </Tile><Tile colour="fixed" id="-800" name="Rostock">
+ <Station id="city1" position="302" type="Town" value="10"/>
+ <Track from="city1" gauge="normal" to="side3"/>
+ </Tile></Tiles>
\ No newline at end of file
Property changes on: trunk/18xx/data/18VA/Tiles.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/18xx/data/GamesList.xml
===================================================================
--- trunk/18xx/data/GamesList.xml 2011-03-14 14:23:05 UTC (rev 1496)
+++ trunk/18xx/data/GamesList.xml 2011-03-14 15:52:15 UTC (rev 1497)
@@ -247,7 +247,29 @@
<Option name="UnlimitedTiles" type="toggle" default="no"/>
<Option name="SeparateSalesAtSamePrice" type="toggle" default="yes"/>
</Game>
-
+ <Game name="18JR">
+ <Note>Prototype</Note>
+ <Description>18JR</Description>
+ <Players minimum="3" maximum="5" />
+ <Option name="Variant" values="Basegame,Cotton Port" default="Basegame" />
+ <Option name="NoMapMode" type="toggle" default="no" />
+ <Option name="RouteAwareness" values="Highlight,Deactivate" default="Deactivate" />
+ <Option name="RevenueCalculation" values="Suggest,Deactivate" default="Deactivate" />
+ <Option name="BeginnerGame" type="toggle" default="no" />
+ <Option name="WithOptional6Train" type="toggle" default="no"/>
+ <Option name="UnlimitedTopTrains" parm="D" type="toggle" default="no"/>
+ <Option name="UnlimitedTiles" type="toggle" default="no"/>
+ <Option name="LeaveAuctionOnPass" type="toggle" default="no"/>
+ <Option name="TwoPlayersCertLimit70Percent" type="toggle" default="yes"/>
+ <Option name="SeparateSalesAtSamePrice" type="toggle" default="yes"/>
+
+ </Game>
+ <Game name="18VA">
+ <Note>Prototype</Note>
+ <Description>18VA</Description>
+ <Players minimum="2" maximum="5" />
+ </Game>
+
<Credits>Rails is a computer implementation of a number of railroad board games,
that are collectively known as the "18xx" railway game system.
Rails is a Sourceforge project.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-14 14:23:11
|
Revision: 1496
http://rails.svn.sourceforge.net/rails/?rev=1496&view=rev
Author: evos
Date: 2011-03-14 14:23:05 +0000 (Mon, 14 Mar 2011)
Log Message:
-----------
Extra off-map tiles for 18VA (and others)
Added Paths:
-----------
trunk/18xx/tiles/svg/tile-1911.svg
trunk/18xx/tiles/svg/tile-1912.svg
trunk/18xx/tiles/svg/tile-1913.svg
trunk/18xx/tiles/svg/tile-1921.svg
trunk/18xx/tiles/svg/tile-1922.svg
trunk/18xx/tiles/svg/tile-1923.svg
trunk/18xx/tiles/svg/tile-4001.svg
trunk/18xx/tiles/svg/tile-4002.svg
trunk/18xx/tiles/svg/tile-4003.svg
trunk/18xx/tiles/svg/tile-911.svg
Added: trunk/18xx/tiles/svg/tile-1911.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-1911.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-1911.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-1912.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-1912.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-1912.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-1913.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-1913.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-1913.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-1921.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-1921.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-1921.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><polygon points="145,119 247,119 247,221 145,221" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="145" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="247" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><polygon points="145,119 247,119 247,221 145,221" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><circle cx="145" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><circle cx="247" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-1922.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-1922.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-1922.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><polygon points="145,119 247,119 247,221 145,221" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="145" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="247" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><polygon points="145,119 247,119 247,221 145,221" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><circle cx="145" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><circle cx="247" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-1923.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-1923.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-1923.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><polygon points="145,119 247,119 247,221 145,221" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="145" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><circle cx="247" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><polygon points="145,119 247,119 247,221 145,221" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><circle cx="145" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><circle cx="247" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-4001.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-4001.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-4001.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><line x1="166" y1="170" x2="226" y2="170" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><line x1="170" y1="170" x2="222" y2="170" stroke="#000000" stroke-width="26" stroke-linecap="butt"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-4002.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-4002.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-4002.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><line x1="166" y1="170" x2="226" y2="170" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><line x1="170" y1="170" x2="222" y2="170" stroke="#000000" stroke-width="26" stroke-linecap="butt"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-4003.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-4003.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-4003.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,85" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 196,340" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="196" cy="170" r="21" fill="#000000" stroke="#FFFFFF" stroke-width="4"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
Added: trunk/18xx/tiles/svg/tile-911.svg
===================================================================
--- trunk/18xx/tiles/svg/tile-911.svg (rev 0)
+++ trunk/18xx/tiles/svg/tile-911.svg 2011-03-14 14:23:05 UTC (rev 1496)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="#FF0000" stroke="#FF0000" stroke-width="1" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="12"/><path d="M 196,170 L 343,255" fill="none" stroke="#FFFFFF" stroke-width="34" stroke-linecap="butt" stroke-linejoin="round"/><path d="M 196,170 L 343,255" fill="none" stroke="#000000" stroke-width="26" stroke-linecap="butt" stroke-linejoin="round"/><circle cx="196" cy="170" r="51" fill="#FFFFFF" stroke="#000000" stroke-width="4"/><path d=" M 98,0 L 294,0 L 392,170 L 294,340 L 98,340 L 0,170 Z" fill="none" stroke="black" stroke-width="1" stroke-linejoin="round"/></svg>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-14 14:20:19
|
Revision: 1495
http://rails.svn.sourceforge.net/rails/?rev=1495&view=rev
Author: evos
Date: 2011-03-14 14:20:13 +0000 (Mon, 14 Mar 2011)
Log Message:
-----------
Extra off-map tiles for 18VA (and others)
Modified Paths:
--------------
trunk/18xx/tiles/TileDictionary.18t
trunk/18xx/tiles/TileDictionary.xml
trunk/18xx/tiles/Tiles.xml
Modified: trunk/18xx/tiles/TileDictionary.18t
===================================================================
(Binary files differ)
Modified: trunk/18xx/tiles/TileDictionary.xml
===================================================================
--- trunk/18xx/tiles/TileDictionary.xml 2011-03-06 22:28:18 UTC (rev 1494)
+++ trunk/18xx/tiles/TileDictionary.xml 2011-03-14 14:20:13 UTC (rev 1495)
@@ -20858,4 +20858,239 @@
</connection>
</connections>
</tile>
+ <tile>
+ <ID>-911</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>OMCity-1</name>
+ <junctions>
+ <junction>
+ <junType>jtCity</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-1911</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>OM1Slot-1</name>
+ <junctions>
+ <junction>
+ <junType>jtCity</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-1912</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>OM1Slot-2</name>
+ <junctions>
+ <junction>
+ <junType>jtCity</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideB</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-1913</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>OM1Slot-3</name>
+ <junctions>
+ <junction>
+ <junType>jtCity</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideB</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideD</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-1921</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>OM2Slot-1</name>
+ <junctions>
+ <junction>
+ <junType>jtDoubleCity</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-1922</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>OM2Slot-2</name>
+ <junctions>
+ <junction>
+ <junType>jtDoubleCity</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideB</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-1923</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>OM2Slot-3</name>
+ <junctions>
+ <junction>
+ <junType>jtDoubleCity</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideB</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideD</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-4001</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>Port-1</name>
+ <junctions>
+ <junction>
+ <junType>jtWhistlestop</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-4002</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>Port-2</name>
+ <junctions>
+ <junction>
+ <junType>jtWhistlestop</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideB</position2>
+ </connection>
+ </connections>
+ </tile>
+ <tile>
+ <ID>-4003</ID>
+ <shape>tsHexagon</shape>
+ <level>tlOffMap</level>
+ <name>Port-3</name>
+ <junctions>
+ <junction>
+ <junType>jtWhistlestop</junType>
+ <position>tpCenter</position>
+ </junction>
+ </junctions>
+ <connections>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideB</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideC</position2>
+ </connection>
+ <connection>
+ <conType>ctNormal</conType>
+ <position1>tpCenter</position1>
+ <position2>tp4SideD</position2>
+ </connection>
+ </connections>
+ </tile>
</tiles>
\ No newline at end of file
Modified: trunk/18xx/tiles/Tiles.xml
===================================================================
--- trunk/18xx/tiles/Tiles.xml 2011-03-06 22:28:18 UTC (rev 1494)
+++ trunk/18xx/tiles/Tiles.xml 2011-03-14 14:20:13 UTC (rev 1495)
@@ -1 +1,3709 @@
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-06 22:28:24
|
Revision: 1494
http://rails.svn.sourceforge.net/rails/?rev=1494&view=rev
Author: evos
Date: 2011-03-06 22:28:18 +0000 (Sun, 06 Mar 2011)
Log Message:
-----------
Reload fixes
Modified Paths:
--------------
trunk/18xx/rails/game/action/BuyTrain.java
trunk/18xx/rails/game/action/LayTile.java
Modified: trunk/18xx/rails/game/action/BuyTrain.java
===================================================================
--- trunk/18xx/rails/game/action/BuyTrain.java 2011-03-06 13:05:43 UTC (rev 1493)
+++ trunk/18xx/rails/game/action/BuyTrain.java 2011-03-06 22:28:18 UTC (rev 1494)
@@ -254,7 +254,9 @@
if (!(action instanceof BuyTrain)) return false;
BuyTrain a = (BuyTrain) action;
return a.getTrain() == getTrain() && a.from == from && a.pricePaid == pricePaid
- && a.addedCash == addedCash && a.exchangedTrainUniqueId.equals(exchangedTrainUniqueId);
+ && a.addedCash == addedCash
+ && (a.exchangedTrainUniqueId == null && exchangedTrainUniqueId == null
+ || a.exchangedTrainUniqueId.equals(exchangedTrainUniqueId));
}
/** Deserialize */
Modified: trunk/18xx/rails/game/action/LayTile.java
===================================================================
--- trunk/18xx/rails/game/action/LayTile.java 2011-03-06 13:05:43 UTC (rev 1493)
+++ trunk/18xx/rails/game/action/LayTile.java 2011-03-06 22:28:18 UTC (rev 1494)
@@ -250,7 +250,8 @@
return (a.laidTileId == laidTileId
&& a.chosenHexName.equals(chosenHexName)
&& a.orientation == orientation
- && a.relaidBaseTokensString.equals(relaidBaseTokensString));
+ && (a.relaidBaseTokensString == null && relaidBaseTokensString == null
+ || a.relaidBaseTokensString.equals(relaidBaseTokensString)));
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-06 13:05:49
|
Revision: 1493
http://rails.svn.sourceforge.net/rails/?rev=1493&view=rev
Author: evos
Date: 2011-03-06 13:05:43 +0000 (Sun, 06 Mar 2011)
Log Message:
-----------
Fixed bad neighbour calculation in NS maps with letters vertical and A odd
Modified Paths:
--------------
trunk/18xx/rails/game/MapHex.java
trunk/18xx/rails/game/MapManager.java
trunk/18xx/rails/ui/swing/hexmap/GUIHex.java
Modified: trunk/18xx/rails/game/MapHex.java
===================================================================
--- trunk/18xx/rails/game/MapHex.java 2011-03-05 20:10:40 UTC (rev 1492)
+++ trunk/18xx/rails/game/MapHex.java 2011-03-06 13:05:43 UTC (rev 1493)
@@ -356,6 +356,7 @@
public void setNeighbor(int orientation, MapHex neighbour) {
orientation %= 6;
neighbours[orientation] = neighbour;
+ //log.debug("+++ Hex="+getName()+":"+orientation+"->"+neighbour.getName());
}
public MapHex getNeighbor(int orientation) {
Modified: trunk/18xx/rails/game/MapManager.java
===================================================================
--- trunk/18xx/rails/game/MapManager.java 2011-03-05 20:10:40 UTC (rev 1492)
+++ trunk/18xx/rails/game/MapManager.java 2011-03-06 13:05:43 UTC (rev 1493)
@@ -124,21 +124,16 @@
}
// Initialise the neighbours
+ int ii, jj;
for (i = minX; i <= maxX; i++) {
for (j = minY; j <= maxY; j++) {
if ((hex = hexes[i][j]) == null) continue;
for (k = 0; k < 6; k++) {
- if (tileOrientation == MapHex.EW) {
- dx = (j % 2 == 0 ? xYEvenDeltaEW[k] : xYOddDeltaEW[k]);
- dy = yDeltaEW[k];
- } else {
- dx = xDeltaNS[k];
- dy = (i % 2 == 0 ? yXEvenDeltaNS[k] : yXOddDeltaNS[k]);
- }
- if (i + dx >= minX && i + dx <= maxX && j + dy >= minY
- && j + dy <= maxY
- && (nb = hexes[i + dx][j + dy]) != null) {
+ ii = getAdjacentX (i, j, k);
+ jj = getAdjacentY (i, j, k);
+ if (ii >= minX && ii <= maxX && jj >= minY && jj <= maxY
+ && (nb = hexes[ii][jj]) != null) {
if (hex.isNeighbour(nb, k)
&& nb.isNeighbour(hex, k + 3)) {
hex.setNeighbor(k, nb);
@@ -146,7 +141,6 @@
}
if (hex.isImpassable(nb) || nb.isImpassable(hex)) {
hex.addImpassableSide(k);
- //nb.addImpassableSide(k+3);
}
}
@@ -177,6 +171,25 @@
public boolean lettersGoHorizontal() {
return lettersGoHorizontal;
}
+
+ public int getAdjacentX (int x, int y, int orientation) {
+
+ if (tileOrientation == MapHex.EW) {
+ return x + (y % 2 == 0 ? xYEvenDeltaEW[orientation] : xYOddDeltaEW[orientation]);
+ } else {
+ return x + xDeltaNS[orientation];
+ }
+ }
+
+ public int getAdjacentY (int x, int y, int orientation) {
+
+ if (tileOrientation == MapHex.EW) {
+ return y + yDeltaEW[orientation];
+ } else {
+ return y + ((x % 2 == 0) == letterAHasEvenNumbers ?
+ yXEvenDeltaNS[orientation] : yXOddDeltaNS[orientation]);
+ }
+ }
/**
* @return Returns the currentTileOrientation.
Modified: trunk/18xx/rails/ui/swing/hexmap/GUIHex.java
===================================================================
--- trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2011-03-05 20:10:40 UTC (rev 1492)
+++ trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2011-03-06 13:05:43 UTC (rev 1493)
@@ -319,21 +319,6 @@
return polygon;
}
- public void setNeighbor(int i, GUIHex hex) {
- if (i >= 0 && i < 6) {
- neighbors[i] = hex;
- getHexModel().setNeighbor(i, hex.getHexModel());
- }
- }
-
- public GUIHex getNeighbor(int i) {
- if (i < 0 || i > 6) {
- return null;
- } else {
- return neighbors[i];
- }
- }
-
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
@@ -704,9 +689,13 @@
if (Util.hasValue(name)) {
tt.append(" (").append(name).append(")");
}
+ // For debugging: display x,y-coordinates
+ //tt.append("<small> x=" + x + " y="+y+"</small>");
+
tt.append("<br><b>Tile</b>: ").append(currentTile.getId());
- // TEMPORARY
- tt.append("<small> rot=" + currentTileOrientation + "</small>");
+
+ // For debugging: display rotation
+ //tt.append("<small> rot=" + currentTileOrientation + "</small>");
if (model.hasOffBoardValues()) {
tt.append("<br>Value ");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ev...@us...> - 2011-03-05 20:10:48
|
Revision: 1492
http://rails.svn.sourceforge.net/rails/?rev=1492&view=rev
Author: evos
Date: 2011-03-05 20:10:40 +0000 (Sat, 05 Mar 2011)
Log Message:
-----------
Implemented game "reload" (loading a file with a later stage of the *same* game)
Modified Paths:
--------------
trunk/18xx/LocalisedText.properties
trunk/18xx/rails/game/Game.java
trunk/18xx/rails/game/GameManager.java
trunk/18xx/rails/game/StartRound_1830.java
trunk/18xx/rails/game/action/BidStartItem.java
trunk/18xx/rails/game/action/BuyBonusToken.java
trunk/18xx/rails/game/action/BuyCertificate.java
trunk/18xx/rails/game/action/BuyPrivate.java
trunk/18xx/rails/game/action/BuyStartItem.java
trunk/18xx/rails/game/action/BuyTrain.java
trunk/18xx/rails/game/action/DiscardTrain.java
trunk/18xx/rails/game/action/ExchangeTokens.java
trunk/18xx/rails/game/action/GameAction.java
trunk/18xx/rails/game/action/LayBaseToken.java
trunk/18xx/rails/game/action/LayBonusToken.java
trunk/18xx/rails/game/action/LayTile.java
trunk/18xx/rails/game/action/LayToken.java
trunk/18xx/rails/game/action/MergeCompanies.java
trunk/18xx/rails/game/action/NullAction.java
trunk/18xx/rails/game/action/PossibleAction.java
trunk/18xx/rails/game/action/PossibleActions.java
trunk/18xx/rails/game/action/ReachDestinations.java
trunk/18xx/rails/game/action/RepayLoans.java
trunk/18xx/rails/game/action/RequestTurn.java
trunk/18xx/rails/game/action/SellShares.java
trunk/18xx/rails/game/action/SetDividend.java
trunk/18xx/rails/game/action/TakeLoans.java
trunk/18xx/rails/game/action/UseSpecialProperty.java
trunk/18xx/rails/game/correct/CashCorrectionAction.java
trunk/18xx/rails/game/correct/ClosePrivate.java
trunk/18xx/rails/game/correct/CorrectionModeAction.java
trunk/18xx/rails/game/correct/MapCorrectionAction.java
trunk/18xx/rails/game/correct/OperatingCost.java
trunk/18xx/rails/game/specific/_1835/FoldIntoPrussian.java
trunk/18xx/rails/game/specific/_18AL/AssignNamedTrains.java
trunk/18xx/rails/ui/swing/GameUIManager.java
trunk/18xx/rails/ui/swing/StatusWindow.java
Removed Paths:
-------------
trunk/18xx/rails/game/action/AssignNamedTrains.java
trunk/18xx/rails/game/action/BuyOrBidStartItem.java
trunk/18xx/rails/game/action/SetSharePrice.java
Property Changed:
----------------
trunk/18xx/tiles/
Modified: trunk/18xx/LocalisedText.properties
===================================================================
--- trunk/18xx/LocalisedText.properties 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/LocalisedText.properties 2011-03-05 20:10:40 UTC (rev 1492)
@@ -498,6 +498,7 @@
REDO=Redo
ReleasedFromEscrow={0} receives {1} released from bank escrow
ReleasesTrains=Makes {0}-trains available for purchasing
+Reload=Reload
RemainingTiles=Remaining tiles
RepayLoans=Repay loan(s)
RepayLoan=Repay {0} loan(s) of {1} for {2}
Modified: trunk/18xx/rails/game/Game.java
===================================================================
--- trunk/18xx/rails/game/Game.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/Game.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -212,6 +212,7 @@
log.debug("Loading game from file " + filepath);
String filename = filepath.replaceAll(".*[/\\\\]", "");
+ /*--- Remember to keep GameManager.reload() in sync with this code! ---*/
try {
ObjectInputStream ois =
new ObjectInputStream(new FileInputStream(
@@ -320,6 +321,7 @@
}
ois.close();
+ ois = null;
gameManager.setReloading(false);
gameManager.finishLoading();
Modified: trunk/18xx/rails/game/GameManager.java
===================================================================
--- trunk/18xx/rails/game/GameManager.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/GameManager.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -920,6 +920,9 @@
case GameAction.SAVE:
result = save(gameAction);
break;
+ case GameAction.RELOAD:
+ result = reload(gameAction);
+ break;
case GameAction.UNDO:
moveStack.undoMoveSet(false);
result = true;
@@ -1111,6 +1114,128 @@
return result;
}
+ @SuppressWarnings("unchecked")
+ protected boolean reload(GameAction reloadAction) {
+
+ String filepath = reloadAction.getFilepath();
+ log.info("Reloading game from file " + filepath);
+ String filename = filepath.replaceAll(".*[/\\\\]", "");
+
+ try {
+ ObjectInputStream ois =
+ new ObjectInputStream(new FileInputStream(
+ new File(filepath)));
+
+ // See Game.load(). Here we don't do as much checking. */
+ Object object = ois.readObject();
+ if (object instanceof String) {
+ log.info("Reading Rails "+(String)object+" saved file "+filename);
+ object = ois.readObject();
+ } else {
+ log.info("Reading Rails (pre-1.0.7) saved file "+filename);
+ }
+ if (object instanceof String) {
+ log.info("File was saved at "+(String)object);
+ object = ois.readObject();
+ }
+ String name = (String) ois.readObject();
+ log.debug("Saved game="+name);
+ Map<String, String> selectedGameOptions =
+ (Map<String, String>) ois.readObject();
+ List<String> playerNames = (List<String>) ois.readObject();
+
+ log.debug("Starting to compare loaded actions");
+
+ List<PossibleAction> savedActions;
+ int numberOfActions = 0;
+ setReloading(true);
+
+ Object actionObject = ois.readObject();
+ if (actionObject instanceof List) {
+ // Old-style: one List of PossibleActions
+ savedActions = (List<PossibleAction>) actionObject;
+ numberOfActions = savedActions.size();
+ } else {
+ // New style: separate PossibleActionsObjects, since Rails 1.3.1
+ savedActions = new ArrayList<PossibleAction>();
+ while (actionObject instanceof PossibleAction) {
+ savedActions.add((PossibleAction) actionObject);
+ numberOfActions++;
+ try {
+ actionObject = ois.readObject();
+ } catch (EOFException e) {
+ break;
+ }
+ }
+ }
+
+ // Check size
+ if (numberOfActions < executedActions.size()) {
+ DisplayBuffer.add(LocalText.getText("LoadFailed",
+ "loaded file has less actions than current game"));
+ return true;
+ }
+
+ // Check action identity
+ int index = 0;
+ PossibleAction executedAction;
+ for (PossibleAction savedAction : savedActions) {
+ if (index < executedActions.size()) {
+ executedAction = executedActions.get(index);
+ if (!savedAction.equalsAsAction(executedAction)) {
+ DisplayBuffer.add(LocalText.getText("LoadFailed",
+ "loaded action \""+savedAction.toString()
+ +"\"<br> is not same as game action \""+executedAction.toString()
+ +"\""));
+ return true;
+ }
+ } else {
+ if (index == executedActions.size()) {
+ log.info("Finished comparing old actions, starting to process new actions");
+ }
+ // Found a new action: execute it
+ if (!processOnReload(savedAction)) {
+ log.error ("Reload interrupted");
+ DisplayBuffer.add(LocalText.getText("LoadFailed",
+ " loaded action \""+savedAction.toString()+"\" is invalid"));
+ break;
+ }
+ }
+ index++;
+ }
+
+ if (actionObject instanceof SortedMap) {
+ ReportBuffer.setCommentItems((SortedMap<Integer, String>) actionObject);
+ log.debug("Found sorted map");
+ } else {
+ try {
+ object = ois.readObject();
+ if (object instanceof SortedMap) {
+ ReportBuffer.setCommentItems((SortedMap<Integer, String>) object);
+ }
+ } catch (IOException e) {
+ // continue without comments, if any IOException occurs
+ // sometimes not only the EOF Exception is raised
+ // but also the java.io.StreamCorruptedException: invalid type code
+ }
+ }
+
+ ois.close();
+ ois = null;
+
+ setReloading(false);
+ finishLoading();
+ log.info("Reloading finished");
+
+ } catch (Exception e) {
+ log.error("Reload failed", e);
+ DisplayBuffer.add(LocalText.getText("LoadFailed", e.getMessage()));
+ return true;
+ }
+
+ return true;
+ }
+
protected boolean export(GameAction exportAction) {
String filename = exportAction.getFilepath();
Modified: trunk/18xx/rails/game/StartRound_1830.java
===================================================================
--- trunk/18xx/rails/game/StartRound_1830.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/StartRound_1830.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -193,7 +193,7 @@
// Check item
boolean validItem = false;
for (StartItemAction activeItem : possibleActions.getType(StartItemAction.class)) {
- if (bidItem.equals(activeItem)) {
+ if (bidItem.equalsAsOption(activeItem)) {
validItem = true;
break;
}
Deleted: trunk/18xx/rails/game/action/AssignNamedTrains.java
===================================================================
--- trunk/18xx/rails/game/action/AssignNamedTrains.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/AssignNamedTrains.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -1,52 +0,0 @@
-package rails.game.action;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-import rails.game.special.SpecialProperty;
-import rails.game.specific._18AL.NameTrains;
-import rails.game.specific._18AL.NamedTrainToken;
-
-public class AssignNamedTrains extends PossibleAction {
-
- transient private NameTrains namedTrainsSpecialProperty;
- private int namedTrainsSpecialPropertyId;
-
- private static final long serialVersionUID = 1L;
-
- public AssignNamedTrains(NameTrains namedTrainsSpecialProperty) {
- this.namedTrainsSpecialProperty = namedTrainsSpecialProperty;
- this.namedTrainsSpecialPropertyId =
- namedTrainsSpecialProperty.getUniqueId();
- }
-
- @Override
- public String toString() {
- StringBuffer b = new StringBuffer("AssignNamedTrains ");
- for (NamedTrainToken token : namedTrainsSpecialProperty.getTokens()) {
- b.append(token.toString()).append(",");
- }
- b.deleteCharAt(b.length() - 1);
- return b.toString();
- }
-
- /** Deserialize */
- private void readObject(ObjectInputStream in) throws IOException,
- ClassNotFoundException {
-
- in.defaultReadObject();
-
- if (namedTrainsSpecialPropertyId > 0) {
- namedTrainsSpecialProperty =
- (NameTrains) SpecialProperty.getByUniqueId(namedTrainsSpecialPropertyId);
- }
- }
-
- @Override
- public boolean equals(PossibleAction pa) {
-
- return pa instanceof AssignNamedTrains
- && ((AssignNamedTrains) pa).namedTrainsSpecialPropertyId == namedTrainsSpecialPropertyId;
- }
-
-}
Modified: trunk/18xx/rails/game/action/BidStartItem.java
===================================================================
--- trunk/18xx/rails/game/action/BidStartItem.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/BidStartItem.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -68,14 +68,21 @@
this.actualBid = actualBid;
}
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof BidStartItem)) return false;
BidStartItem a = (BidStartItem) action;
return a.startItem == startItem && a.itemIndex == itemIndex
&& a.minimumBid == minimumBid;
}
- public String toString() {
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof BidStartItem)) return false;
+ BidStartItem a = (BidStartItem) action;
+ return a.equalsAsOption(this)
+ && a.actualBid == actualBid;
+ }
+
+ public String toString() {
StringBuffer b = new StringBuffer();
b.append("BidStartItem ").append(startItemName).append(" minbid=").append(
minimumBid).append(" selected=").append(selected).append(
Modified: trunk/18xx/rails/game/action/BuyBonusToken.java
===================================================================
--- trunk/18xx/rails/game/action/BuyBonusToken.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/BuyBonusToken.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -90,7 +90,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof BuyBonusToken)) return false;
BuyBonusToken a = (BuyBonusToken) action;
return a.privateCompany == privateCompany
@@ -100,6 +100,10 @@
&& a.locationString.equals(locationString);
}
+ public boolean equalsAsAction(PossibleAction action) {
+ return action.equalsAsOption (this);
+ }
+
@Override
public String toString() {
return "BuyBonusToken " + privateCompanyName
Modified: trunk/18xx/rails/game/action/BuyCertificate.java
===================================================================
--- trunk/18xx/rails/game/action/BuyCertificate.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/BuyCertificate.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -106,7 +106,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof BuyCertificate)) return false;
BuyCertificate a = (BuyCertificate) action;
return a.certificate == certificate && a.from == from
@@ -114,6 +114,14 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof BuyCertificate)) return false;
+ BuyCertificate a = (BuyCertificate) action;
+ return a.certificate == certificate && a.from == from
+ && a.price == price && a.numberBought == numberBought;
+ }
+
+ @Override
public String toString() {
StringBuffer text = new StringBuffer();
text.append("BuyCertificate: ");
Deleted: trunk/18xx/rails/game/action/BuyOrBidStartItem.java
===================================================================
--- trunk/18xx/rails/game/action/BuyOrBidStartItem.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/BuyOrBidStartItem.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -1,153 +0,0 @@
-/* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/game/action/BuyOrBidStartItem.java,v 1.11 2009/01/08 19:59:39 evos Exp $
- *
- * Created on 17-Sep-2006
- * Change Log:
- */
-package rails.game.action;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-
-import rails.game.PublicCompanyI;
-import rails.game.StartItem;
-
-/**
- * @author Erik Vos
- */
-public class BuyOrBidStartItem extends PossibleAction {
-
- /* Server-provided fields */
- transient private StartItem startItem;
- private String startItemName;
- private boolean sharePriceToSet = false;
- private String companyNeedingSharePrice = null;
- /** Unused but retained to keep old saved files loadable */
- private int type;
-
- /*
- * Status of the start item (buyable? biddable?) for the <i>current</i>
- * player, taking into account the amount of cash of this player that is
- * blocked by bids on other items.
- */
- private int priceOrMinimumBid;
- private int bidIncrement;
- private int itemIndex;
-
- /* Client-provided fields */
- private int actualBid = 0;
- private int sharePrice = 0;
-
- // Constants
- public static final int BUY_IMMEDIATE = 1;
- public static final int SELECT_AND_BUY = 2;
- public static final int BID_IMMEDIATE = 3;
- public static final int SELECT_AND_BID = 4;
- public static final int SELECT_AND_BID_OR_PASS = 5;
- public static final int SET_SHARE_PRICE = 6;
-
- public static final long serialVersionUID = 2L;
-
- /**
- *
- */
- public BuyOrBidStartItem(StartItem startItem, int priceOrMinimumBid,
- int type) {
-
- super();
- this.startItem = startItem;
- this.startItemName = startItem.getName();
- this.itemIndex = startItem.getIndex();
- this.priceOrMinimumBid = priceOrMinimumBid;
-
- PublicCompanyI company;
- if ((company = startItem.needsPriceSetting()) != null) {
- sharePriceToSet = true;
- companyNeedingSharePrice = company.getName();
- }
- }
-
- /**
- * @return Returns the startItem.
- */
- public StartItem getStartItem() {
- return startItem;
- }
-
- public int getItemIndex() {
- return itemIndex;
- }
-
- public int getBidIncrement() {
- return bidIncrement;
- }
-
- public void setBidIncrement(int bidIncrement) {
- this.bidIncrement = bidIncrement;
- }
-
- public int getActualBid() {
- return actualBid;
- }
-
- public void setActualBid(int actualBid) {
- this.actualBid = actualBid;
- }
-
- public int getSharePrice() {
- return sharePrice;
- }
-
- public void setSharePrice(int sharePrice) {
- this.sharePrice = sharePrice;
- }
-
- public boolean hasSharePriceToSet() {
- return sharePriceToSet;
- }
-
- public String getCompanyToSetPriceFor() {
- return companyNeedingSharePrice;
- }
-
- public int getPriceOrMinimumBid() {
- return priceOrMinimumBid;
- }
-
- @Override
- public boolean equals(PossibleAction action) {
- if (!(action instanceof BuyOrBidStartItem)) return false;
- BuyOrBidStartItem a = (BuyOrBidStartItem) action;
- return a.startItem == startItem && a.itemIndex == itemIndex
- && a.type == type;
- }
-
- @Override
- public String toString() {
- StringBuffer b = new StringBuffer();
- b.append("BuyOrBidStartItem ").append(startItemName).append(" status=");
- b.append(startItem.getStatusName());
-
- switch (startItem.getStatus()) {
- case StartItem.BIDDABLE:
- b.append(" minbid=").append(priceOrMinimumBid).append(" bid=").append(
- actualBid);
- break;
- case StartItem.BUYABLE:
- b.append(" price=").append(priceOrMinimumBid);
- break;
- case StartItem.NEEDS_SHARE_PRICE:
- b.append(" startprice=").append(sharePrice);
- break;
- }
- return b.toString();
- }
-
- private void readObject(ObjectInputStream in) throws IOException,
- ClassNotFoundException {
-
- in.defaultReadObject();
-
- startItem = StartItem.getByName(startItemName);
-
- }
-}
Modified: trunk/18xx/rails/game/action/BuyPrivate.java
===================================================================
--- trunk/18xx/rails/game/action/BuyPrivate.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/BuyPrivate.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -68,7 +68,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof BuyPrivate)) return false;
BuyPrivate a = (BuyPrivate) action;
return a.privateCompany == privateCompany
@@ -77,6 +77,14 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof BuyPrivate)) return false;
+ BuyPrivate a = (BuyPrivate) action;
+ return a.privateCompany == privateCompany
+ && a.price == price;
+ }
+
+ @Override
public String toString() {
return "BuyPrivate " + privateCompany.getName() + " holder="
+ privateCompany.getPortfolio().getName();
Modified: trunk/18xx/rails/game/action/BuyStartItem.java
===================================================================
--- trunk/18xx/rails/game/action/BuyStartItem.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/BuyStartItem.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -76,14 +76,21 @@
return companyNeedingSharePrice;
}
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof BuyStartItem)) return false;
BuyStartItem a = (BuyStartItem) action;
return a.startItem == startItem && a.itemIndex == itemIndex
&& a.price == price;
}
- public String toString() {
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof BuyStartItem)) return false;
+ BuyStartItem a = (BuyStartItem) action;
+ return a.equalsAsOption(this)
+ && a.associatedSharePrice == associatedSharePrice;
+ }
+
+ public String toString() {
StringBuffer b = new StringBuffer();
b.append("BuyStartItem ").append(startItemName).append(" price=").append(
price).append(" selected=").append(selected);
Modified: trunk/18xx/rails/game/action/BuyTrain.java
===================================================================
--- trunk/18xx/rails/game/action/BuyTrain.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/BuyTrain.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -242,13 +242,21 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof BuyTrain)) return false;
BuyTrain a = (BuyTrain) action;
return a.getTrain() == getTrain() && a.from == from && a.fixedCost == fixedCost
&& a.trainsForExchange == trainsForExchange;
}
+ @Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof BuyTrain)) return false;
+ BuyTrain a = (BuyTrain) action;
+ return a.getTrain() == getTrain() && a.from == from && a.pricePaid == pricePaid
+ && a.addedCash == addedCash && a.exchangedTrainUniqueId.equals(exchangedTrainUniqueId);
+ }
+
/** Deserialize */
private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
Modified: trunk/18xx/rails/game/action/DiscardTrain.java
===================================================================
--- trunk/18xx/rails/game/action/DiscardTrain.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/DiscardTrain.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -84,12 +84,19 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof DiscardTrain)) return false;
DiscardTrain a = (DiscardTrain) action;
return a.ownedTrains == ownedTrains && a.company == company;
}
+ @Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof DiscardTrain)) return false;
+ DiscardTrain a = (DiscardTrain) action;
+ return a.discardedTrain == discardedTrain && a.company == company;
+ }
+
/** Deserialize */
private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
Modified: trunk/18xx/rails/game/action/ExchangeTokens.java
===================================================================
--- trunk/18xx/rails/game/action/ExchangeTokens.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/ExchangeTokens.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -71,12 +71,22 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof ExchangeTokens)) return false;
ExchangeTokens a = (ExchangeTokens) action;
return a.tokensToExchange == tokensToExchange && a.company == company;
}
+ @Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!action.equalsAsOption(this)) return false;
+ ExchangeTokens a = (ExchangeTokens) action;
+ for (int i=0; i<tokensToExchange.size(); i++) {
+ if (a.tokensToExchange.get(i).isSelected() != tokensToExchange.get(i).isSelected()) return false;
+ }
+ return true;
+ }
+
/** Deserialize */
private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
Modified: trunk/18xx/rails/game/action/GameAction.java
===================================================================
--- trunk/18xx/rails/game/action/GameAction.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/GameAction.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -10,16 +10,17 @@
public static final int FORCED_UNDO = 3;
public static final int REDO = 4;
public static final int EXPORT = 5;
- public static final int MAX_MODE = 5;
+ public static final int RELOAD = 6;
+ public static final int MAX_MODE = 6;
private String[] name =
- new String[] { "Save", "Load", "Undo", "Undo!", "Redo", "Export" };
+ new String[] { "Save", "Load", "Undo", "Undo!", "Redo", "Export", "Reload" };
// Server-side settings
protected int mode = -1;
// Client-side settings
- protected String filepath; // Only applies to SAVE and LOAD
+ protected String filepath = null; // Only applies to SAVE, LOAD and RELOAD
protected int moveStackIndex = -1; // target moveStackIndex, only for FORCED_UNDO and REDO
public static final long serialVersionUID = 1L;
@@ -50,12 +51,19 @@
return mode;
}
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof GameAction)) return false;
GameAction a = (GameAction) action;
return a.mode == mode;
}
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof GameAction)) return false;
+ GameAction a = (GameAction) action;
+ return a.mode == mode && (
+ (a.filepath == null && filepath == null) || a.filepath.equals(filepath));
+ }
+
public String toString() {
return name[mode];
}
Modified: trunk/18xx/rails/game/action/LayBaseToken.java
===================================================================
--- trunk/18xx/rails/game/action/LayBaseToken.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/LayBaseToken.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -71,7 +71,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof LayBaseToken)) return false;
LayBaseToken a = (LayBaseToken) action;
return (a.locationNames == null && locationNames == null || a.locationNames.equals(locationNames))
@@ -81,6 +81,17 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof LayBaseToken)) return false;
+ LayBaseToken a = (LayBaseToken) action;
+ return a.chosenHex == chosenHex
+ && a.chosenStation == chosenStation
+ && a.type == type
+ && a.company == company
+ && a.specialProperty == specialProperty;
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer("LayBaseToken ");
if (chosenHex == null) {
Modified: trunk/18xx/rails/game/action/LayBonusToken.java
===================================================================
--- trunk/18xx/rails/game/action/LayBonusToken.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/LayBonusToken.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -44,7 +44,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof LayBonusToken)) return false;
LayBonusToken a = (LayBonusToken) action;
return (a.locationNames == null && locationNames == null || a.locationNames.equals(locationNames))
@@ -52,6 +52,14 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof LayBonusToken)) return false;
+ LayBonusToken a = (LayBonusToken) action;
+ return a.chosenHex == chosenHex
+ && a.company == company && a.specialProperty == specialProperty;
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer("LayBonusToken ");
if (chosenHex == null) {
Modified: trunk/18xx/rails/game/action/LayTile.java
===================================================================
--- trunk/18xx/rails/game/action/LayTile.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/LayTile.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -233,16 +233,27 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof LayTile)) return false;
LayTile a = (LayTile) action;
return (a.locationNames == null && locationNames == null || a.locationNames.equals(locationNames))
&& a.type == type
&& a.tileColours == tileColours
- && a.tiles == tiles && a.specialProperty == specialProperty;
+ && a.tiles == tiles
+ && a.specialProperty == specialProperty;
}
@Override
+ public boolean equalsAsAction (PossibleAction action) {
+ if (!(action instanceof LayTile)) return false;
+ LayTile a = (LayTile) action;
+ return (a.laidTileId == laidTileId
+ && a.chosenHexName.equals(chosenHexName)
+ && a.orientation == orientation
+ && a.relaidBaseTokensString.equals(relaidBaseTokensString));
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer("LayTile");
if (laidTile == null) {
Modified: trunk/18xx/rails/game/action/LayToken.java
===================================================================
--- trunk/18xx/rails/game/action/LayToken.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/LayToken.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -92,19 +92,6 @@
// TODO this.specialPropertyUniqueId = specialProperty.getUniqueId();
}
- /**
- * @deprecated
- * @return Returns the location.
- */
- @Deprecated
- public MapHex getLocation() {
- if (locations != null) {
- return locations.get(0);
- } else {
- return null;
- }
- }
-
public List<MapHex> getLocations() {
return locations;
}
Modified: trunk/18xx/rails/game/action/MergeCompanies.java
===================================================================
--- trunk/18xx/rails/game/action/MergeCompanies.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/MergeCompanies.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -100,7 +100,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof MergeCompanies)) return false;
MergeCompanies a = (MergeCompanies) action;
return a.mergingCompanyName.equals(mergingCompanyName)
@@ -108,6 +108,15 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof MergeCompanies)) return false;
+ MergeCompanies a = (MergeCompanies) action;
+ return a.mergingCompanyName.equals(mergingCompanyName)
+ && a.selectedTargetCompanyName.equals(selectedTargetCompanyName)
+ && a.replaceToken == replaceToken;
+ }
+
+ @Override
public String toString() {
StringBuffer text = new StringBuffer();
text.append("MergeCompanies: ").append(mergingCompanyName).append(
Modified: trunk/18xx/rails/game/action/NullAction.java
===================================================================
--- trunk/18xx/rails/game/action/NullAction.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/NullAction.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -37,13 +37,18 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof NullAction)) return false;
NullAction a = (NullAction) action;
return a.mode == mode;
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ return equalsAsOption(action);
+ }
+
+ @Override
public String toString() {
if (optionalLabel != null) return optionalLabel;
return name[mode];
Modified: trunk/18xx/rails/game/action/PossibleAction.java
===================================================================
--- trunk/18xx/rails/game/action/PossibleAction.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/PossibleAction.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -72,8 +72,34 @@
this.acted = true;
}
- public abstract boolean equals(PossibleAction pa);
+ /**
+ * Compare the choice options of two action objects, without regard to whatever choice has been made, if any.
+ * In other words: only the server-set (prior) attributes must be compared.
+ * <p>This method is used by the server (engine) to validate
+ * the incoming action that has actually been chosen in the client (GUI),
+ * but only for the purpose to check if the chosen option was really on offer,
+ * not to check if the chosen action is actually valid.
+ * These perspectives could give different results in cases where
+ * the PossibleAction does not fully restrict choices to valid values only
+ * (such as the blanket LayTile that does no restrict the hex to lay a tile on,
+ * or the SetDividend that will accept any revenue value).
+ * @param pa Another PossibleAction to compare with.
+ * @return True if the compared PossibleAction object has equal choice options.
+ */
+ public abstract boolean equalsAsOption (PossibleAction pa);
+ /**
+ * Compare the chosen actions of two action objects.
+ * In other words: the client-set (posterior) attributes must be compared,
+ * in addition to those server-set (prior) attributes that sufficiently identify the action.
+ * <p>This method is used by the server (engine) to check if two action
+ * objects represent the same actual action, as is done when reloading a saved file
+ * (i.e. loading a later stage of the same game).
+ * @param pa Another PossibleAction to compare with.
+ * @return True if the compared PossibleAction object has equal selected action values.
+ */
+ public abstract boolean equalsAsAction (PossibleAction pa);
+
protected GameManagerI getGameManager() {
return GameManager.getInstance();
}
Modified: trunk/18xx/rails/game/action/PossibleActions.java
===================================================================
--- trunk/18xx/rails/game/action/PossibleActions.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/PossibleActions.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -96,16 +96,17 @@
/** Check if a given action exists in the current list of possible actions */
public boolean validate(PossibleAction checkedAction) {
- // Save is always allowed
+ // Some actions are always allowed
if (checkedAction instanceof GameAction
&& (((GameAction)checkedAction).getMode() == GameAction.SAVE
- || ((GameAction)checkedAction).getMode() == GameAction.EXPORT)) {
+ || ((GameAction)checkedAction).getMode() == GameAction.RELOAD
+ || ((GameAction)checkedAction).getMode() == GameAction.EXPORT)) {
return true;
}
// Check if action accurs in the list of possible actions
for (PossibleAction action : possibleActions) {
- if (action.equals(checkedAction)) {
+ if (action.equalsAsOption(checkedAction)) {
return true;
}
}
Modified: trunk/18xx/rails/game/action/ReachDestinations.java
===================================================================
--- trunk/18xx/rails/game/action/ReachDestinations.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/ReachDestinations.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -61,16 +61,22 @@
return reachedCompanies;
}
-
-
@Override
- public boolean equals(PossibleAction pa) {
+ public boolean equalsAsOption(PossibleAction pa) {
if (!(pa instanceof ReachDestinations)) return false;
ReachDestinations rd = (ReachDestinations) pa;
return possibleCompanyNames.equals(rd.getPossibleCompanyNames());
}
- @Override
+ @Override
+ public boolean equalsAsAction(PossibleAction pa) {
+ if (!(pa instanceof ReachDestinations)) return false;
+ ReachDestinations rd = (ReachDestinations) pa;
+ return possibleCompanyNames.equals(rd.possibleCompanyNames)
+ && reachedCompanyNames.equals(rd.reachedCompanyNames);
+ }
+
+ @Override
public String toString() {
StringBuffer text = new StringBuffer();
text.append("ReachDestinations: ").append(possibleCompanyNames);
Modified: trunk/18xx/rails/game/action/RepayLoans.java
===================================================================
--- trunk/18xx/rails/game/action/RepayLoans.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/RepayLoans.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -78,7 +78,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof RepayLoans)) return false;
RepayLoans a = (RepayLoans) action;
return a.company == company
@@ -88,6 +88,15 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof RepayLoans)) return false;
+ RepayLoans a = (RepayLoans) action;
+ return a.company == company
+ && a.numberRepaid == numberRepaid
+ && a.price == price;
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer();
b.append ("RepayLoans ").append(company.getName())
Modified: trunk/18xx/rails/game/action/RequestTurn.java
===================================================================
--- trunk/18xx/rails/game/action/RequestTurn.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/RequestTurn.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -24,12 +24,16 @@
}
@Override
- public boolean equals(PossibleAction pa) {
+ public boolean equalsAsOption(PossibleAction pa) {
return pa != null
&& pa instanceof RequestTurn
&& requestingPlayerName.equals(((RequestTurn)pa).requestingPlayerName);
}
+ public boolean equalsAsAction(PossibleAction pa) {
+ return equalsAsOption (pa);
+ }
+
private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException {
Modified: trunk/18xx/rails/game/action/SellShares.java
===================================================================
--- trunk/18xx/rails/game/action/SellShares.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/SellShares.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -91,7 +91,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof SellShares)) return false;
SellShares a = (SellShares) action;
return a.getCompanyName().equals(companyName)
@@ -101,6 +101,16 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof SellShares)) return false;
+ SellShares a = (SellShares) action;
+ return a.companyName.equals(companyName)
+ && a.shareUnits == shareUnits
+ && a.numberSold == numberSold
+ && a.price == price;
+ }
+
+ @Override
public String toString() {
return "SellShares: "
+ (numberSold > 0 ? numberSold : "max " + maximumNumber)
Modified: trunk/18xx/rails/game/action/SetDividend.java
===================================================================
--- trunk/18xx/rails/game/action/SetDividend.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/SetDividend.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -148,7 +148,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof SetDividend)) return false;
SetDividend a = (SetDividend) action;
return a.company == company
@@ -160,6 +160,15 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof SetDividend)) return false;
+ SetDividend a = (SetDividend) action;
+ return a.company == company
+ && a.actualRevenue == actualRevenue
+ && a.revenueAllocation == revenueAllocation;
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer();
b.append(getClass().getSimpleName()).append(": ").append(company.getName());
Deleted: trunk/18xx/rails/game/action/SetSharePrice.java
===================================================================
--- trunk/18xx/rails/game/action/SetSharePrice.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/SetSharePrice.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -1,75 +0,0 @@
-/* $Header: /Users/blentz/rails_rcs/cvs/18xx/rails/game/action/SetSharePrice.java,v 1.2 2008/06/04 19:00:29 evos Exp $
- *
- * Created on 17-Sep-2006
- * Change Log:
- */
-package rails.game.action;
-
-import rails.game.PublicCompanyI;
-import rails.game.StartItem;
-
-/**
- * @author Erik Vos
- */
-public class SetSharePrice extends StartItemAction {
-
- /* Server-provided fields */
- private boolean sharePriceToSet = false;
- private String companyNeedingSharePrice = null;
-
- // Client-provided fields
- private int associatedSharePrice;
-
- public static final long serialVersionUID = 1L;
-
- /**
- *
- */
- public SetSharePrice(StartItem startItem) {
-
- super(startItem);
-
- PublicCompanyI company;
- if ((company = startItem.needsPriceSetting()) != null) {
- sharePriceToSet = true;
- companyNeedingSharePrice = company.getName();
- }
- }
-
- public int getAssociatedSharePrice() {
- return associatedSharePrice;
- }
-
- public void setAssociatedSharePrice(int sharePrice) {
- this.associatedSharePrice = sharePrice;
- }
-
- public boolean hasSharePriceToSet() {
- return sharePriceToSet;
- }
-
- public String getCompanyToSetPriceFor() {
- return companyNeedingSharePrice;
- }
-
- /** @deprecated */
- public int getStatus() {
- // if (startItem == null) return 0;//BAD
- return startItem.getStatus();
- }
-
- public boolean equals(PossibleAction action) {
- if (!(action instanceof SetSharePrice)) return false;
- SetSharePrice a = (SetSharePrice) action;
- return a.startItem == startItem && a.itemIndex == itemIndex;
- }
-
- public String toString() {
- StringBuffer b = new StringBuffer();
- b.append("SetSharePrice ").append(startItemName).append(" shareprice=").append(
- associatedSharePrice).append(
- " for company " + companyNeedingSharePrice);
- return b.toString();
- }
-
-}
Modified: trunk/18xx/rails/game/action/TakeLoans.java
===================================================================
--- trunk/18xx/rails/game/action/TakeLoans.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/TakeLoans.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -66,7 +66,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof TakeLoans)) return false;
TakeLoans a = (TakeLoans) action;
return a.company == company
@@ -75,6 +75,15 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof TakeLoans)) return false;
+ TakeLoans a = (TakeLoans) action;
+ return a.company == company
+ && a.numberTaken == numberTaken
+ && a.price == price;
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer();
b.append ("TakeLoans ").append(company.getName())
Modified: trunk/18xx/rails/game/action/UseSpecialProperty.java
===================================================================
--- trunk/18xx/rails/game/action/UseSpecialProperty.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/action/UseSpecialProperty.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -42,12 +42,16 @@
return specialProperty;
}
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof UseSpecialProperty)) return false;
UseSpecialProperty a = (UseSpecialProperty) action;
return a.specialProperty == specialProperty;
}
+ public boolean equalsAsAction(PossibleAction action) {
+ return action.equalsAsOption(this);
+ }
+
public String toString() {
StringBuffer b = new StringBuffer("UseSpecialProperty: ");
if (specialProperty != null) b.append(specialProperty);
Modified: trunk/18xx/rails/game/correct/CashCorrectionAction.java
===================================================================
--- trunk/18xx/rails/game/correct/CashCorrectionAction.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/correct/CashCorrectionAction.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -81,14 +81,24 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof CashCorrectionAction)) return false;
CashCorrectionAction a = (CashCorrectionAction) action;
return (a.correctCashHolder == this.correctCashHolder &&
a.maximumNegative == this.maximumNegative
);
}
+
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof CashCorrectionAction)) return false;
+ CashCorrectionAction a = (CashCorrectionAction) action;
+ return (a.correctCashHolder == this.correctCashHolder &&
+ a.correctAmount == this.correctAmount
+ );
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer("CashCorrectionAction ");
if (acted) {
Modified: trunk/18xx/rails/game/correct/ClosePrivate.java
===================================================================
--- trunk/18xx/rails/game/correct/ClosePrivate.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/correct/ClosePrivate.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -42,13 +42,18 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof ClosePrivate)) return false;
ClosePrivate a = (ClosePrivate) action;
return (a.privateCompany == this.privateCompany);
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ return action.equalsAsOption(this);
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer("ClosePrivate");
if (!acted) {
Modified: trunk/18xx/rails/game/correct/CorrectionModeAction.java
===================================================================
--- trunk/18xx/rails/game/correct/CorrectionModeAction.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/correct/CorrectionModeAction.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -40,7 +40,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof CorrectionModeAction)) return false;
CorrectionModeAction a = (CorrectionModeAction) action;
return (a.correctionType.equals(this.correctionType) &&
@@ -48,6 +48,11 @@
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ return action.equalsAsOption(this);
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer("CorrectionModeAction");
if (!acted) {
Modified: trunk/18xx/rails/game/correct/MapCorrectionAction.java
===================================================================
--- trunk/18xx/rails/game/correct/MapCorrectionAction.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/correct/MapCorrectionAction.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -2,8 +2,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
import rails.game.correct.MapCorrectionManager.*;
import rails.game.BaseToken;
@@ -177,13 +176,23 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof MapCorrectionAction)) return false;
MapCorrectionAction a = (MapCorrectionAction) action;
return (a.step == this.step);
}
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof MapCorrectionAction)) return false;
+ MapCorrectionAction a = (MapCorrectionAction) action;
+ return (a.step == this.step
+ && a.location == location
+ && a.tiles.get(0) == tiles.get(0))
+ && a.orientation == orientation;
+ }
+
+ @Override
public String toString(){
StringBuffer b = new StringBuffer("MapCorrectionAction");
if (acted) {
Modified: trunk/18xx/rails/game/correct/OperatingCost.java
===================================================================
--- trunk/18xx/rails/game/correct/OperatingCost.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/correct/OperatingCost.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -74,7 +74,7 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof OperatingCost)) return false;
OperatingCost a = (OperatingCost) action;
return (a.company == this.company &&
@@ -83,7 +83,18 @@
a.maximumCost == this.maximumCost
);
}
+
@Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof OperatingCost)) return false;
+ OperatingCost a = (OperatingCost) action;
+ return (a.company == this.company &&
+ a.operatingCostType == this.operatingCostType &&
+ a.operatingCost == this.operatingCost
+ );
+ }
+
+ @Override
public String toString() {
StringBuffer b = new StringBuffer("OperatingCost");
if (!acted) {
Modified: trunk/18xx/rails/game/specific/_1835/FoldIntoPrussian.java
===================================================================
--- trunk/18xx/rails/game/specific/_1835/FoldIntoPrussian.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/specific/_1835/FoldIntoPrussian.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -70,12 +70,18 @@
}
@Override
- public boolean equals(PossibleAction action) {
+ public boolean equalsAsOption(PossibleAction action) {
if (!(action instanceof FoldIntoPrussian)) return false;
FoldIntoPrussian a = (FoldIntoPrussian) action;
return a.foldableCompanyNames.equals(foldableCompanyNames);
}
+ @Override
+ public boolean equalsAsAction(PossibleAction action) {
+ if (!(action instanceof FoldIntoPrussian)) return false;
+ FoldIntoPrussian a = (FoldIntoPrussian) action;
+ return a.equalsAsOption(this) && a.foldedCompanyNames.equals(foldedCompanyNames);
+ }
/** Deserialize */
private void readObject(ObjectInputStream in) throws IOException,
Modified: trunk/18xx/rails/game/specific/_18AL/AssignNamedTrains.java
===================================================================
--- trunk/18xx/rails/game/specific/_18AL/AssignNamedTrains.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/game/specific/_18AL/AssignNamedTrains.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -2,11 +2,10 @@
import java.io.IOException;
import java.io.ObjectInputStream;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
import rails.game.*;
-import rails.game.action.UseSpecialProperty;
+import rails.game.action.*;
public class AssignNamedTrains extends UseSpecialProperty {
@@ -61,6 +60,12 @@
}
}
}
+
+ public boolean equalsAsAction (PossibleAction action) {
+ if (!(action instanceof AssignNamedTrains)) return false;
+ AssignNamedTrains a = (AssignNamedTrains) action;
+ return Arrays.equals(a.postTrainIds, postTrainIds);
+ }
@Override
public String toMenu() {
Modified: trunk/18xx/rails/ui/swing/GameUIManager.java
===================================================================
--- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -775,7 +775,23 @@
}
- public void setSaveDirectory(String saveDirectory) {
+ public void reloadGame(GameAction reloadAction) {
+
+ JFileChooser jfc = new JFileChooser();
+ jfc.setCurrentDirectory(new File(saveDirectory));
+
+ if (jfc.showOpenDialog(statusWindow) == JFileChooser.APPROVE_OPTION) {
+ File selectedFile = jfc.getSelectedFile();
+ saveDirectory = selectedFile.getParent();
+ reloadAction.setFilepath(selectedFile.getPath());
+ processOnServer(reloadAction);
+ } else { // cancel pressed
+ return;
+ }
+
+ }
+
+ public void setSaveDirectory(String saveDirectory) {
this.saveDirectory = saveDirectory;
}
Modified: trunk/18xx/rails/ui/swing/StatusWindow.java
===================================================================
--- trunk/18xx/rails/ui/swing/StatusWindow.java 2011-02-28 21:12:48 UTC (rev 1491)
+++ trunk/18xx/rails/ui/swing/StatusWindow.java 2011-03-05 20:10:40 UTC (rev 1492)
@@ -30,6 +30,8 @@
protected static final String SAVE_CMD = "Save";
+ protected static final String RELOAD_CMD = "Reload";
+
protected static final String EXPORT_CMD = "Export";
protected static final String UNDO_CMD = "Undo";
@@ -79,7 +81,7 @@
private JMenuItem menuItem;
private ActionMenuItem saveItem;
-// private ActionMenuItem exportItem;
+ private ActionMenuItem reloadItem;
private ActionMenuItem undoItem, forcedUndoItem, redoItem, redoItem2;
@@ -117,6 +119,16 @@
saveItem.setPossibleAction(new GameAction(GameAction.SAVE));
fileMenu.add(saveItem);
+ reloadItem = new ActionMenuItem(LocalText.getText("Reload"));
+ reloadItem.setActionCommand(RELOAD_CMD);
+ reloadItem.setMnemonic(KeyEvent.VK_R);
+ reloadItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R,
+ ActionEvent.ALT_MASK));
+ reloadItem.addActionListener(this);
+ reloadItem.setEnabled(true);
+ reloadItem.setPossibleAction(new GameAction(GameAction.RELOAD));
+ fileMenu.add(reloadItem);
+
// export menu item
// exportItem = new ActionMenuItem(LocalText.getText("EXPORT"));
// exportItem.setActionCommand(EXPORT_CMD);
@@ -630,6 +642,9 @@
case GameAction.SAVE:
gameUIManager.saveGame((GameAction) executedAction);
break;
+ case GameAction.RELOAD:
+ gameUIManager.reloadGame((GameAction) executedAction);
+ break;
case GameAction.EXPORT:
gameUIManager.exportGame((GameAction) executedAction);
break;
Property changes on: trunk/18xx/tiles
___________________________________________________________________
Modified: svn:ignore
- Copy of TileDictionary.18t
handmade
TDwithID
TDwoID
xml
tileimages.xml
Copy (2) of TileDictionary.18t
Copy (3) of TileDictionary.18t
Rails18xx.ini
UserGridStyle.ini
UserTileStyle.ini
*.exe
o
+ Copy of TileDictionary.18t
handmade
TDwithID
TDwoID
xml
tileimages.xml
Copy (2) of TileDictionary.18t
Copy (3) of TileDictionary.18t
Rails18xx.ini
UserGridStyle.ini
UserTileStyle.ini
*.exe
o
TDindex.pl
TDindex.txt
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|