Update of /cvsroot/rails/18xx/rails/game
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv23647/rails/game
Modified Files:
OperatingRound.java PrivateCompany.java PrivateCompanyI.java
Log Message:
Adds CloseManually Tag for Privates
Index: OperatingRound.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/OperatingRound.java,v
retrieving revision 1.124
retrieving revision 1.125
diff -C2 -d -r1.124 -r1.125
*** OperatingRound.java 30 Apr 2010 09:35:35 -0000 1.124
--- OperatingRound.java 1 May 2010 16:08:13 -0000 1.125
***************
*** 2162,2165 ****
--- 2162,2171 ----
setGameSpecificPossibleActions();
+ // Private Company manually closure
+ for (PrivateCompanyI priv: companyManager.getAllPrivateCompanies()) {
+ if (!priv.isClosed() && priv.closesManually())
+ possibleActions.add(new ClosePrivate(priv));
+ }
+
// Can private companies be bought?
if (getCurrentPhase().isPrivateSellingAllowed()) {
***************
*** 2317,2325 ****
// }
- // Private Company Closure
- for (PrivateCompanyI priv: companyManager.getAllPrivateCompanies()) {
- if ((!priv.isClosed()) && (priv.closesIfAllExercised() || priv.closesIfAnyExercised()))
- possibleActions.add(new ClosePrivate(priv));
- }
}
--- 2323,2326 ----
Index: PrivateCompanyI.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompanyI.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PrivateCompanyI.java 21 Mar 2010 17:43:50 -0000 1.11
--- PrivateCompanyI.java 1 May 2010 16:08:13 -0000 1.12
***************
*** 40,43 ****
--- 40,44 ----
public boolean closesIfAnyExercised();
public boolean closesAtEndOfTurn();
+ public boolean closesManually();
public void checkClosingIfExercised(boolean endOfOR);
}
Index: PrivateCompany.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/PrivateCompany.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** PrivateCompany.java 21 Apr 2010 19:16:44 -0000 1.41
--- PrivateCompany.java 1 May 2010 16:08:13 -0000 1.42
***************
*** 30,33 ****
--- 30,35 ----
// Close at start of phase
protected String closeAtPhaseName = null;
+ // Manual close possible
+ protected boolean closeManually = false;
protected String blockedHexesString = null;
***************
*** 96,100 ****
}
}
! /* start sfy 1889 */
List<Tag> preventTags = closureTag.getChildren("PreventClosing");
if (preventTags != null) {
--- 98,103 ----
}
}
!
! /* conditions that prevent closing */
List<Tag> preventTags = closureTag.getChildren("PreventClosing");
if (preventTags != null) {
***************
*** 106,110 ****
}
}
! /* end sfy 1889 */
// Close at start of phase
--- 109,118 ----
}
}
!
! /* allow manual closure */
! Tag manualTag = closureTag.getChild("CloseManually");
! if (manualTag != null) {
! closeManually = true;
! }
// Close at start of phase
***************
*** 350,353 ****
--- 358,365 ----
return closeAtEndOfTurn;
}
+
+ public boolean closesManually() {
+ return closeManually;
+ }
public void checkClosingIfExercised (boolean endOfTurn) {
|