Update of /cvsroot/rails/18xx/rails/game/specific/_1856
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30959/rails/game/specific/_1856
Modified Files:
OperatingRound_1856.java CGRFormationRound.java
Log Message:
Fixed in 1856:
1. Loop if CGR does not discard any non-permanent train
2. Error if new OR starts immediately after CGR formation.
Index: CGRFormationRound.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/CGRFormationRound.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** CGRFormationRound.java 27 Nov 2009 20:35:18 -0000 1.24
--- CGRFormationRound.java 27 Dec 2009 18:30:11 -0000 1.25
***************
*** 6,9 ****
--- 6,10 ----
import rails.game.action.*;
import rails.game.move.CashMove;
+ import rails.game.state.BooleanState;
import rails.game.state.IntegerState;
import rails.util.LocalText;
***************
*** 26,29 ****
--- 27,31 ----
private IntegerState stepObject = new IntegerState ("CGRFormStep", 0);
+ private BooleanState cgrHasDiscardedTrains = new BooleanState ("CGRDiscardedTrains", false);
public static final int STEP_REPAY_LOANS = 1;
***************
*** 708,712 ****
forcedTrainDiscard = true;
return true;
! } else {
// Check if CGR still has non-permanent trains
// these may be discarded voluntarily
--- 710,714 ----
forcedTrainDiscard = true;
return true;
! } else if (!this.cgrHasDiscardedTrains.booleanValue()) {
// Check if CGR still has non-permanent trains
// these may be discarded voluntarily
***************
*** 789,792 ****
--- 791,796 ----
train.getName() ));
+ } else {
+ cgrHasDiscardedTrains.set(true);
}
Index: OperatingRound_1856.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/specific/_1856/OperatingRound_1856.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** OperatingRound_1856.java 26 Dec 2009 12:49:58 -0000 1.26
--- OperatingRound_1856.java 27 Dec 2009 18:30:11 -0000 1.27
***************
*** 64,68 ****
} else {
operatingCompany = operatingCompanyArray[operatingCompanyIndex];
-
// 1856 special: check if the company has sold enough shares to operate
// This check does not apply to the CGR
--- 64,67 ----
***************
*** 464,468 ****
// End of CGRFormationRound
finalLoanRepaymentPending.set(false);
! resetOperatingCompanies(mergingCompanies);
if (operatingCompany != null) {
setStep(STEP_INITIAL);
--- 463,467 ----
// End of CGRFormationRound
finalLoanRepaymentPending.set(false);
! if (!resetOperatingCompanies(mergingCompanies)) return;
if (operatingCompany != null) {
setStep(STEP_INITIAL);
***************
*** 473,477 ****
}
! private void resetOperatingCompanies(List<PublicCompanyI> mergingCompanies) {
List<PublicCompanyI> companies
--- 472,476 ----
}
! private boolean resetOperatingCompanies(List<PublicCompanyI> mergingCompanies) {
List<PublicCompanyI> companies
***************
*** 541,546 ****
} else {
finishOR();
}
!
}
--- 540,546 ----
} else {
finishOR();
+ return false;
}
! return true;
}
|