Update of /cvsroot/rails/18xx/rails/game/correct
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25304/rails/game/correct
Modified Files:
CorrectionAction.java CashCorrectionManager.java
Log Message:
Added nextPlayerMessages and fixed reload bug of cashcorrection action.
Index: CorrectionAction.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/correct/CorrectionAction.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CorrectionAction.java 8 Mar 2010 20:33:21 -0000 1.5
--- CorrectionAction.java 10 Mar 2010 21:02:22 -0000 1.6
***************
*** 11,17 ****
--- 11,20 ----
public abstract class CorrectionAction extends PossibleAction {
+
transient protected CorrectionType correctionType;
protected String correctionName;
+ public static final long serialVersionUID = 3L;
+
public CorrectionType getCorrectionType() {
return correctionType;
***************
*** 24,27 ****
--- 27,31 ----
public void setCorrectionType(CorrectionType correctionType) {
this.correctionType = correctionType;
+ this.correctionName = correctionType.name();
}
}
Index: CashCorrectionManager.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/correct/CashCorrectionManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CashCorrectionManager.java 8 Mar 2010 20:33:21 -0000 1.2
--- CashCorrectionManager.java 10 Mar 2010 21:02:22 -0000 1.3
***************
*** 113,129 ****
Bank bank = gameManager.getBank();
if (amount < 0) {
// negative amounts: remove cash from cashholder
new CashMove(ch, bank , -amount);
! ReportBuffer.add(LocalText.getText("CorrectCashSubstractMoney",
ch.getName(),
! Bank.format(-amount) ));
! } else if (amount > 0) {
// positive amounts: add cash to cashholder
new CashMove(bank, ch, amount);
! ReportBuffer.add(LocalText.getText("CorrectCashAddMoney",
ch.getName(),
! Bank.format(amount) ));
}
result = true;
}
--- 113,133 ----
Bank bank = gameManager.getBank();
+ String msg;
if (amount < 0) {
// negative amounts: remove cash from cashholder
new CashMove(ch, bank , -amount);
!
! msg = LocalText.getText("CorrectCashSubstractMoney",
ch.getName(),
! Bank.format(-amount) );
! } else {
// positive amounts: add cash to cashholder
new CashMove(bank, ch, amount);
! msg = LocalText.getText("CorrectCashAddMoney",
ch.getName(),
! Bank.format(amount));
}
+ ReportBuffer.add(msg);
+ gameManager.addToNextPlayerMessages(msg, true);
result = true;
}
|