Update of /cvsroot/rails/18xx/rails/game
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6845/rails/game
Modified Files:
Round.java
Log Message:
Added some generic getters.
Cleanups
Index: Round.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Round.java 30 Dec 2009 11:32:31 -0000 1.33
--- Round.java 14 Jan 2010 21:00:30 -0000 1.34
***************
*** 10,13 ****
--- 10,14 ----
import org.apache.log4j.Logger;
+ import rails.common.GuiHints;
import rails.game.action.*;
import rails.game.move.CashMove;
***************
*** 23,26 ****
--- 24,28 ----
protected PossibleActions possibleActions = PossibleActions.getInstance();
+ protected GuiHints guiHints = null;
protected static Logger log =
***************
*** 38,42 ****
protected MapManager mapManager = null;
! protected Class<? extends RoundI> roundTypeForUI = null;
protected BooleanState wasInterrupted = new BooleanState ("RoundInterrupted", false);
--- 40,44 ----
protected MapManager mapManager = null;
! //protected Class<? extends RoundI> roundTypeForUI = null;
protected BooleanState wasInterrupted = new BooleanState ("RoundInterrupted", false);
***************
*** 53,73 ****
this.gameManager = aGameManager;
! if (aGameManager == null) {
companyManager = null;
} else {
! companyManager = aGameManager.getCompanyManager();
! playerManager = aGameManager.getPlayerManager();
! bank = aGameManager.getBank();
ipo = bank.getIpo();
pool = bank.getPool();
unavailable = bank.getUnavailable();
scrapHeap = bank.getScrapHeap();
! stockMarket = aGameManager.getStockMarket();
! mapManager = aGameManager.getMapManager();
! moveStack = aGameManager.getMoveStack();
}
! roundTypeForUI = getClass();
}
--- 55,77 ----
this.gameManager = aGameManager;
! if (gameManager == null) {
companyManager = null;
} else {
! companyManager = gameManager.getCompanyManager();
! playerManager = gameManager.getPlayerManager();
! bank = gameManager.getBank();
ipo = bank.getIpo();
pool = bank.getPool();
unavailable = bank.getUnavailable();
scrapHeap = bank.getScrapHeap();
! stockMarket = gameManager.getStockMarket();
! mapManager = gameManager.getMapManager();
! moveStack = gameManager.getMoveStack();
}
! //roundTypeForUI = getClass();
! guiHints = gameManager.getUIHints();
! guiHints.setCurrentRoundType(getClass());
}
***************
*** 98,101 ****
--- 102,113 ----
}
+ protected List<Player> getPlayers() {
+ return gameManager.getPlayers();
+ }
+
+ protected int getNumberOfPlayers() {
+ return gameManager.getNumberOfPlayers();
+ }
+
public PhaseI getCurrentPhase() {
return gameManager.getCurrentPhase();
***************
*** 112,118 ****
}
! public void setRoundTypeForUI(Class<? extends RoundI> roundTypeForUI) {
! this.roundTypeForUI = roundTypeForUI;
! }
public String getGameOption (String name) {
--- 124,130 ----
}
! //public void setRoundTypeForUI(Class<? extends RoundI> roundTypeForUI) {
! // this.roundTypeForUI = roundTypeForUI;
! //}
public String getGameOption (String name) {
***************
*** 345,354 ****
for (PublicCompanyI c : companyManager.getAllPublicCompanies()) {
if (c.hasFloated() && !c.isClosed()) {
! ReportBuffer.add(LocalText.getText("Has", c.getName(),
Bank.format(c.getCash())));
}
}
for (Player p : playerManager.getPlayers()) {
! ReportBuffer.add(LocalText.getText("Has", p.getName(),
Bank.format(p.getCash())));
}
--- 357,366 ----
for (PublicCompanyI c : companyManager.getAllPublicCompanies()) {
if (c.hasFloated() && !c.isClosed()) {
! ReportBuffer.add(LocalText.getText("Has", c.getName(),
Bank.format(c.getCash())));
}
}
for (Player p : playerManager.getPlayers()) {
! ReportBuffer.add(LocalText.getText("Has", p.getName(),
Bank.format(p.getCash())));
}
|