|
From: Dr. M. B. <neu...@us...> - 2012-06-03 10:38:09
|
rails/game/specific/_1880/StartRound_1880.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 0ba698c0f26c14adfe719ba30ac5bd088fe60478
Author: Martin Brumm <Dr....@t-...>
Date: Sun Jun 3 12:36:58 2012 +0200
Fixed bidding determination
diff --git a/rails/game/specific/_1880/StartRound_1880.java b/rails/game/specific/_1880/StartRound_1880.java
index 9c2ecde..9591da8 100644
--- a/rails/game/specific/_1880/StartRound_1880.java
+++ b/rails/game/specific/_1880/StartRound_1880.java
@@ -360,7 +360,7 @@ public class StartRound_1880 extends StartRound {
private void setNextBiddingPlayer(StartItem item, int currentIndex) {
for (int i = currentIndex + 1; i < currentIndex
+ gameManager.getNumberOfPlayers(); i++) {
- if (item.getBid(gameManager.getPlayerByIndex(i)) >=0) {
+ if (item.getBid(gameManager.getPlayerByIndex(i)) >0) {
setCurrentPlayerIndex(i);
break;
}
|
|
From: Dr. M. B. <neu...@us...> - 2012-06-30 19:22:59
|
rails/game/specific/_1880/StartRound_1880.java | 34 ++++++++++++++++++++++---
1 file changed, 31 insertions(+), 3 deletions(-)
New commits:
commit 3e96281f14a2b0c08bfc015fb31d5a31d03e5601
Author: Martin Brumm <Dr....@t-...>
Date: Sat Jun 30 21:22:07 2012 +0200
Fixed Startround bidding and passing routine.
diff --git a/rails/game/specific/_1880/StartRound_1880.java b/rails/game/specific/_1880/StartRound_1880.java
index 9591da8..69d5fd5 100644
--- a/rails/game/specific/_1880/StartRound_1880.java
+++ b/rails/game/specific/_1880/StartRound_1880.java
@@ -36,6 +36,8 @@ public class StartRound_1880 extends StartRound {
private final IntegerState investorChosen =
new IntegerState("InvestorChosen",0);
+
+ protected IntegerState playersActed = new IntegerState("PlayersActedinStartround");
/** A company in need for a par price. */
PublicCompanyI companyNeedingPrice = null;
@@ -80,6 +82,7 @@ public class StartRound_1880 extends StartRound {
if (currentItem == null || currentItem.get() != item ) { // we haven't seen this item before
numPasses.set(0); // new round so cancel all previous passes !
+ playersActed.set(0);
currentItem.set(item);
item.setStatus(StartItem.BIDDABLE);
item.setStatus(StartItem.BUYABLE);
@@ -134,6 +137,7 @@ public class StartRound_1880 extends StartRound {
} else {
// Can't bid: Autopass
numPasses.add(1);
+ playersActed.add(1);
return false;
}
} else { // Item is not a private ! should be a major or minor in 1880 special rules apply.
@@ -234,12 +238,16 @@ public class StartRound_1880 extends StartRound {
moveStack.start(false);
+ if (! item.hasBid(player)) {
+ playersActed.add(1);
+ }
item.setBid(bidAmount, player);
ReportBuffer.add(LocalText.getText("BID_ITEM_LOG",
playerName,
Bank.format(bidAmount),
item.getName(),
Bank.format(player.getCash()) ));
+
if ((item.getBidders() >0) && (numPasses.intValue()== getNumberOfPlayers()-1)) {
// All but the highest bidder have passed.
int price = item.getBid();
@@ -253,6 +261,7 @@ public class StartRound_1880 extends StartRound {
}
auctionItemState.set(null);
numPasses.set(0);
+ playersActed.set(0);
setNextStartingPlayer();
return true;
} else {
@@ -293,6 +302,7 @@ public class StartRound_1880 extends StartRound {
moveStack.start(false);
numPasses.add(1);
+ playersActed.add(1);
if (numPasses.intValue() >= numPlayers) {
// All players have passed.
@@ -307,6 +317,7 @@ public class StartRound_1880 extends StartRound {
auctionItem.getName(),
Bank.format(startPacket.getFirstItem().getBasePrice()) ));
numPasses.set(0);
+ playersActed.set(0);
if (auctionItem.getBasePrice() == 0) {
assignItem((Player)startingPlayer.get(),
auctionItem, 0, 0);
@@ -315,6 +326,7 @@ public class StartRound_1880 extends StartRound {
}
} else {
numPasses.set(0);
+ playersActed.set(0);
finishRound();
}
@@ -333,6 +345,7 @@ public class StartRound_1880 extends StartRound {
}
auctionItemState.set(null);
numPasses.set(0);
+ playersActed.set(0);
setNextStartingPlayer();
return true;
} else {
@@ -358,11 +371,26 @@ public class StartRound_1880 extends StartRound {
}
private void setNextBiddingPlayer(StartItem item, int currentIndex) {
+ boolean bidState = false;
for (int i = currentIndex + 1; i < currentIndex
+ gameManager.getNumberOfPlayers(); i++) {
- if (item.getBid(gameManager.getPlayerByIndex(i)) >0) {
- setCurrentPlayerIndex(i);
- break;
+ /*
+ * Ok we need to make sure that every one has at least the chance to bid once.
+ * We need to make sure that everyone that has passed cant bid again.
+ * Unfortunately getBid() or hasBid() return 0 so they cant be of use here until the second bidding round !
+ * Now we only need a status indicator how many people have acted already....
+ */
+ if (playersActed.intValue() == numPlayers) {
+ bidState = item.hasBid(gameManager.getPlayerByIndex(i));
+ if (bidState == true) {
+ setCurrentPlayerIndex(i);
+ break;
+ } else {
+ continue;
+ }
+ } else {
+ setCurrentPlayerIndex(i);
+ break;
}
}
}
|
|
From: Dr. M. B. <neu...@us...> - 2012-07-01 14:29:00
|
rails/game/specific/_1880/OperatingRound_1880.java | 28 +--------------------
1 file changed, 2 insertions(+), 26 deletions(-)
New commits:
commit 558a2bbf2500b660e27a76f4197ca7987378d6b9
Author: Martin Brumm <Dr....@t-...>
Date: Sat Jun 30 22:57:29 2012 +0200
Fixed duplicated Code
diff --git a/rails/game/specific/_1880/OperatingRound_1880.java b/rails/game/specific/_1880/OperatingRound_1880.java
index adc4b3d..9af0f54 100644
--- a/rails/game/specific/_1880/OperatingRound_1880.java
+++ b/rails/game/specific/_1880/OperatingRound_1880.java
@@ -15,17 +15,14 @@ import rails.common.GuiDef;
import rails.common.LocalText;
import rails.game.Bank;
import rails.game.BaseToken;
-import rails.game.Bonus;
import rails.game.CashHolder;
import rails.game.GameDef;
-import rails.game.GameManager;
import rails.game.GameManagerI;
import rails.game.MapHex;
import rails.game.OperatingRound;
import rails.game.PhaseI;
import rails.game.Player;
import rails.game.Portfolio;
-import rails.game.PrivateCompanyI;
import rails.game.PublicCertificateI;
import rails.game.PublicCompanyI;
import rails.game.ReportBuffer;
@@ -47,7 +44,6 @@ import rails.game.special.SpecialTrainBuy;
import rails.game.specific._1880.PublicCompany_1880;
import rails.game.specific._1880.GameManager_1880;
import rails.game.state.EnumState;
-import rails.ui.swing.GameUIManager;
import rails.util.SequenceUtil;
/**
@@ -497,7 +493,7 @@ public class OperatingRound_1880 extends OperatingRound {
));
} else {
int reducedCash = ((cash /10) * 2); //20 Percent of the Cash will move to the Owner
- new CashMove (comp, owner, cash);
+ new CashMove (comp, owner, reducedCash);
ReportBuffer.add(LocalText.getText("CashtransferfromInvestor",
company.getName(),
Bank.format(cash)
@@ -505,27 +501,6 @@ public class OperatingRound_1880 extends OperatingRound {
}
company.setClosed();
-
- // TODO: investorCashToOwner needs to be gotten from the Owner of the
- // Investor...
- // TODO: we need to automatically move 20% of the Cash to the owner if
- // the Investor is still alive on Game end..
- if (investorCashToOwner != true) {
- new CashMove(comp, controlCompany, cash);
- ReportBuffer.add(LocalText.getText("CashtransferfromInvestor",
- company.getName(), Bank.format(cash)));
- } else {
- if (cash > 0) {
- int reducedCash = ((cash / 10) * 2); // 20 Percent of the Cash
- // will move to the Owner
- new CashMove(comp, owner, reducedCash);
- ReportBuffer.add(LocalText.getText("CashTransferFromInvestor",
- company.getName(), Bank.format(cash)));
- }
- ReportBuffer.add(LocalText.getText("NoCashTransferFromInvestor",
- company.getName(), Bank.format(0)));
- }
- company.setClosed();
}
/* (non-Javadoc)
@@ -577,6 +552,7 @@ public class OperatingRound_1880 extends OperatingRound {
* 4. LAYING TILES
*=======================================*/
+ @Override
public boolean layTile(LayTile action) {
String errMsg = null;
|