rails/game/Game.java | 23 +++++++++++------------
rails/util/Util.java | 3 ++-
2 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 96df44d6455bdc191cc5a19d794d9a7f2dc0260c
Author: Erik Vos <eri...@xs...>
Date: Thu Feb 23 14:23:15 2012 +0100
Fixed JUnit testing issue caused by NDC removal.
The initial "GameIs" report message has been moved from the Game constructor
to its setup() method.
Also fixed a problem in Util.joinWithDelimiter that has surfaced
by adding a new usage to display tile colour restrictions in LayTile.toString().
diff --git a/rails/game/Game.java b/rails/game/Game.java
index a882493..393040f 100644
--- a/rails/game/Game.java
+++ b/rails/game/Game.java
@@ -14,7 +14,7 @@ import rails.game.action.PossibleAction;
import rails.util.GameFileIO;
public class Game {
- // the correct version number and develop status
+ // the correct version number and develop status
// is set during initialLoad in Config class
private static String version = "unknown";
private static boolean develop = false;
@@ -22,11 +22,11 @@ public class Game {
public static void setVersion(String version) {
Game.version = version;
}
-
+
public static String getVersion() {
return version;
}
-
+
public static String getFullVersion() {
if (develop) {
return version + "+";
@@ -34,17 +34,17 @@ public class Game {
return version;
}
}
-
+
public static void setDevelop(boolean develop) {
Game.develop = develop;
}
-
+
public static boolean getDevelop() {
return develop;
}
-
+
// in the following the Game objects are defined
-
+
/** The component Manager */
protected GameManager gameManager;
protected CompanyManagerI companyManager;
@@ -85,11 +85,6 @@ public class Game {
this.players = players;
-
- log.info("========== Start of rails.game " + name + " ==========");
- log.info("Rails version "+version);
- ReportBuffer.add(LocalText.getText("GameIs", name));
-
}
public String start() {
@@ -118,6 +113,10 @@ public class Game {
bank = gfp.getBank();
gameManager = gfp.getGameManager();
+ log.info("========== Start of rails.game " + name + " ==========");
+ log.info("Rails version "+version);
+ ReportBuffer.add(LocalText.getText("GameIs", name));
+
/*
* Initializations that involve relations between components can
* only be done after all XML has been processed.
diff --git a/rails/util/Util.java b/rails/util/Util.java
index e558719..25c716a 100644
--- a/rails/util/Util.java
+++ b/rails/util/Util.java
@@ -35,9 +35,10 @@ public final class Util {
}
public static String joinWithDelimiter (String[] sa, String delimiter) {
+ if (sa == null || sa.length == 0) return "";
StringBuilder b = new StringBuilder();
for (String s : sa) {
- if (b.length() > 0) b.append(delimiter);
+ if (Util.hasValue(delimiter) && b.length() > 0) b.append(delimiter);
b.append(s);
}
return b.toString();
|