From: Erik V. <ev...@us...> - 2009-01-08 19:59:45
|
Update of /cvsroot/rails/18xx/rails/game/specific/_18EU In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15164/rails/game/specific/_18EU Modified Files: StartRound_18EU.java Log Message: Start item status tooltips & colours Index: StartRound_18EU.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/specific/_18EU/StartRound_18EU.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StartRound_18EU.java 23 Dec 2008 19:59:06 -0000 1.5 --- StartRound_18EU.java 8 Jan 2009 19:59:39 -0000 1.6 *************** *** 2,7 **** package rails.game.specific._18EU; - import java.util.List; - import rails.game.*; import rails.game.action.*; --- 2,5 ---- *************** *** 56,66 **** } - /** - * Get a list of items that may be bought immediately. <p> In an 1835-style - * auction this method will usually return several items. - * - * @return An array of start items that can be bought. - */ - // public StartItem[] getBuyableItems() {return null;} @Override public boolean setPossibleActions() { --- 54,57 ---- *************** *** 74,78 **** switch (getStep()) { case SELECT_STEP: ! // In the selection step, all not yet sold items are buyable. // The current player MUST select an item, // and may then bid for it or pass. --- 65,69 ---- switch (getStep()) { case SELECT_STEP: ! // In the selection step, all not yet sold items are selectable. // The current player MUST select an item, // and may then bid for it or pass. *************** *** 83,87 **** for (StartItem item : itemsToSell) { if (!item.isSold()) { ! item.setStatus(StartItem.BIDDABLE); item.setMinimumBid(item.getBasePrice()); BidStartItem possibleAction = --- 74,78 ---- for (StartItem item : itemsToSell) { if (!item.isSold()) { ! item.setStatus(StartItem.SELECTABLE); item.setMinimumBid(item.getBasePrice()); BidStartItem possibleAction = *************** *** 89,93 **** startPacket.getModulus(), false, true); possibleActions.add(possibleAction); - // /item.setStatus (StartItem.BIDDABLE); } } --- 80,83 ---- *************** *** 122,130 **** @Override - public List<StartItem> getStartItems() { - return startPacket.getItems(); - } - - @Override protected boolean buy(String playerName, BuyStartItem boughtItem) { StartItem item = boughtItem.getStartItem(); --- 112,115 ---- *************** *** 137,141 **** // Is the item buyable? ! if (status == StartItem.BUYABLE) { price = currentBuyPrice.intValue(); } else { --- 122,126 ---- // Is the item buyable? ! if (status == StartItem.AUCTIONED && currentStep.intValue() == BUY_STEP) { price = currentBuyPrice.intValue(); } else { *************** *** 144,148 **** } ! if (status == StartItem.BUYABLE && player.getFreeCash() < price) { errMsg = LocalText.getText("NoMoney"); break; --- 129,133 ---- } ! if (player.getFreeCash() < price) { errMsg = LocalText.getText("NoMoney"); break; *************** *** 247,250 **** --- 232,240 ---- currentAuctionItem.set(item); item.setStatus(StartItem.AUCTIONED); + for (StartItem item2 : itemsToSell) { + if (item2 != item && !item2.isSold()) { + item2.setStatus(StartItem.UNAVAILABLE); + } + } if (bidAmount == -1) { setStep(OPEN_STEP); *************** *** 314,320 **** Bank.format(currentBuyPrice.intValue()) })); setStep(BUY_STEP); ! if (auctionedItem.getStatus() != StartItem.BUYABLE) { ! auctionedItem.setStatus(StartItem.BUYABLE); ! } if (currentBuyPrice.intValue() == 0) { // Forced buy --- 304,310 ---- Bank.format(currentBuyPrice.intValue()) })); setStep(BUY_STEP); ! //if (auctionedItem.getStatus() != StartItem.BUYABLE) { ! // auctionedItem.setStatus(StartItem.BUYABLE); ! //} if (currentBuyPrice.intValue() == 0) { // Forced buy |