From: Erik V. <ev...@us...> - 2012-03-18 15:25:49
|
rails/game/specific/_1880/OffBoardRevenueModifier_1880.java | 2 rails/game/specific/_1880/StartRound_1880.java | 21 +++++- rails/ui/swing/gamespecific/_1880/StartRoundWindow_1880.java | 36 +++++------ 3 files changed, 37 insertions(+), 22 deletions(-) New commits: commit d351b1a60f95c4dd78ea0ddedc60e311b6b1f87b Author: Martin Brumm <Dr....@t-...> Date: Sun Mar 18 16:03:21 2012 +0100 1880: fixed the reported bugs by Phil Davies. diff --git a/rails/game/specific/_1880/OffBoardRevenueModifier_1880.java b/rails/game/specific/_1880/OffBoardRevenueModifier_1880.java index 7580a5c..d8cbf97 100644 --- a/rails/game/specific/_1880/OffBoardRevenueModifier_1880.java +++ b/rails/game/specific/_1880/OffBoardRevenueModifier_1880.java @@ -29,7 +29,7 @@ public class OffBoardRevenueModifier_1880 implements RevenueStaticModifier { // 1. get the two off-board type stations (Russia and Wladiwostok) Set<NetworkVertex> offBoard = new HashSet<NetworkVertex>(); for (NetworkVertex vertex:revenueAdapter.getVertices()) { // We just need the two offboard Cities - if (vertex.isStation() && ((vertex.getStation().getName().equals("Russia") ||(vertex.getStation().getName().equals("Wladiwostok"))))) { + if (vertex.isStation() && ((vertex.getStation().getName().equals("Russia") ||(vertex.getStation().getName().equals("Vladivostok"))))) { offBoard.add(vertex); } } diff --git a/rails/game/specific/_1880/StartRound_1880.java b/rails/game/specific/_1880/StartRound_1880.java index d906796..9c2ecde 100644 --- a/rails/game/specific/_1880/StartRound_1880.java +++ b/rails/game/specific/_1880/StartRound_1880.java @@ -240,8 +240,25 @@ public class StartRound_1880 extends StartRound { 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(); + + log.debug("Highest bidder is " + + item.getBidder().getName()); + if (item.needsPriceSetting() != null) { + item.setStatus(StartItem.NEEDS_SHARE_PRICE); + } else { + assignItem(item.getBidder(), item, price, 0); + } + auctionItemState.set(null); + numPasses.set(0); + setNextStartingPlayer(); + return true; + } else { setNextBiddingPlayer(item); return true; + } } @@ -294,17 +311,15 @@ public class StartRound_1880 extends StartRound { assignItem((Player)startingPlayer.get(), auctionItem, 0, 0); setNextStartingPlayer(); - // startPacket.getFirstItem().getName()); return true; } } else { numPasses.set(0); - //gameManager.nextRound(this); finishRound(); } } - // if ((numPasses.intValue() >= auctionItem.getBidders() - 1) && + if ((auctionItem.getBidders() >0) && (numPasses.intValue()== getNumberOfPlayers()-1)) { // All but the highest bidder have passed. int price = auctionItem.getBid(); diff --git a/rails/ui/swing/gamespecific/_1880/StartRoundWindow_1880.java b/rails/ui/swing/gamespecific/_1880/StartRoundWindow_1880.java index dc264d2..7683295 100644 --- a/rails/ui/swing/gamespecific/_1880/StartRoundWindow_1880.java +++ b/rails/ui/swing/gamespecific/_1880/StartRoundWindow_1880.java @@ -77,22 +77,22 @@ public class StartRoundWindow_1880 extends StartRoundWindow { // Get a sorted prices List // TODO: should be included in BuyStartItem - List<StockSpaceI> startSpaces = stockMarket.getStartSpaces(); - Map<Integer, StockSpaceI> spacePerPrice = - new HashMap<Integer, StockSpaceI>(); - startPrices = new int[startSpaces.size()]; - String[] options = new String[startSpaces.size()]; - for (int i = 0; i < startSpaces.size(); i++) { - if (((StockMarket_1880) stockMarket).getParSlot(startSpaces.get(i).getPrice())) { //Make sure we got a Parslot left over - startPrices[i] = startSpaces.get(i).getPrice(); - spacePerPrice.put(startPrices[i], startSpaces.get(i)); - } - } - Arrays.sort(startPrices); - for (int i = 0; i < startSpaces.size(); i++) { - options[i] = Bank.format(spacePerPrice.get(startPrices[i]).getPrice()); - } - +// List<StockSpaceI> startSpaces = stockMarket.getStartSpaces(); +// Map<Integer, StockSpaceI> spacePerPrice = +// new HashMap<Integer, StockSpaceI>(); +// startPrices = new int[startSpaces.size()]; + String[] options = {""}; +// for (int i = 0; i < startSpaces.size(); i++) { +// if (((StockMarket_1880) stockMarket).getParSlot(startSpaces.get(i).getPrice())) { //Make sure we got a Parslot left over +// startPrices[i] = startSpaces.get(i).getPrice(); +// spacePerPrice.put(startPrices[i], startSpaces.get(i)); +// } +// } +// Arrays.sort(startPrices); +// for (int i = 0; i < startSpaces.size(); i++) { +// options[i] = Bank.format(spacePerPrice.get(startPrices[i]).getPrice()); +// } + options[0] = "100"; RadioButtonDialog dialog = new RadioButtonDialog( COMPANY_START_PRICE_DIALOG, this, @@ -102,7 +102,7 @@ public class StartRoundWindow_1880 extends StartRoundWindow { activeItem.getPlayerName(), compName), options, - -1); + 0); setCurrentDialog (dialog, activeItem); } return true; @@ -143,7 +143,7 @@ public class StartRoundWindow_1880 extends StartRoundWindow { int index = dialog.getSelectedOption(); if (index >= 0) { - int price = startPrices[index]; + int price = 100; action.setAssociatedSharePrice(price); ((StockMarket_1880) stockMarket).setParSlot(price); |