|
From: <wak...@us...> - 2011-06-30 18:27:58
|
Revision: 1596
http://rails.svn.sourceforge.net/rails/?rev=1596&view=rev
Author: wakko666
Date: 2011-06-30 18:27:52 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Commit Erik's changes to OperatingRound.
Modified Paths:
--------------
trunk/18xx/rails/game/OperatingRound.java
Modified: trunk/18xx/rails/game/OperatingRound.java
===================================================================
--- trunk/18xx/rails/game/OperatingRound.java 2011-06-30 15:19:12 UTC (rev 1595)
+++ trunk/18xx/rails/game/OperatingRound.java 2011-06-30 18:27:52 UTC (rev 1596)
@@ -241,11 +241,6 @@
} else if (selectedAction instanceof ClosePrivate) {
result = executeClosePrivate((ClosePrivate)selectedAction);
-
- } else if (selectedAction instanceof UseSpecialProperty
- && ((UseSpecialProperty)selectedAction).getSpecialProperty() instanceof SpecialRight) {
-
- result = buyRight ((UseSpecialProperty)selectedAction);
} else if (selectedAction instanceof NullAction) {
@@ -2310,44 +2305,6 @@
return numberOfLoans * operatingCompany.get().getValuePerLoan();
}
- protected boolean buyRight (UseSpecialProperty action) {
-
- String errMsg = null;
-
- SpecialPropertyI sp = action.getSpecialProperty();
- if (!(sp instanceof SpecialRight)) {
- errMsg = "Wrong right property class: "+sp.toString();
- }
-
- SpecialRight right = (SpecialRight) sp;
- String rightName = right.getName();
- String rightValue = right.getValue();
-
- if (errMsg != null) {
- DisplayBuffer.add(LocalText.getText("CannotBuyRight",
- action.getCompanyName(),
- rightName,
- Bank.format(right.getCost()),
- errMsg));
-
- return false;
- }
-
- moveStack.start(true);
-
- operatingCompany.get().setRight(rightName, rightValue);
- new CashMove (operatingCompany.get(), bank, right.getCost());
-
- ReportBuffer.add(LocalText.getText("BuysRight",
- operatingCompany.get().getName(),
- rightName,
- Bank.format(right.getCost())));
-
- sp.setExercised();
-
- return true;
- }
-
/*----- METHODS TO BE CALLED TO SET UP THE NEXT TURN -----*/
/**
@@ -2529,13 +2486,10 @@
// Are there other step-independent special properties owned by the company?
List<SpecialPropertyI> orsps = operatingCompany.get().getPortfolio().getAllSpecialProperties();
- List<SpecialPropertyI> compsps = operatingCompany.get().getSpecialProperties();
- if (compsps != null) orsps.addAll(compsps);
-
if (orsps != null) {
for (SpecialPropertyI sp : orsps) {
if (!sp.isExercised() && sp.isUsableIfOwnedByCompany()
- && sp.isUsableDuringOR(step)) {
+ && sp.isUsableDuringOR()) {
if (sp instanceof SpecialTokenLay) {
if (getStep() != GameDef.OrStep.LAY_TOKEN) {
possibleActions.add(new LayBaseToken((SpecialTokenLay)sp));
@@ -2551,7 +2505,7 @@
if (orsps != null) {
for (SpecialPropertyI sp : orsps) {
if (!sp.isExercised() && sp.isUsableIfOwnedByPlayer()
- && sp.isUsableDuringOR(step)) {
+ && sp.isUsableDuringOR()) {
if (sp instanceof SpecialTokenLay) {
if (getStep() != GameDef.OrStep.LAY_TOKEN) {
possibleActions.add(new LayBaseToken((SpecialTokenLay)sp));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|