From: Erik V. <ev...@us...> - 2009-11-23 18:32:55
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv613/rails/game Modified Files: Round.java StartRound_1830.java GamesInfo.java GameOption.java PublicCompany.java Log Message: Added new GameOption "LeaveAuctionOnPass" to 1830-style games Index: StartRound_1830.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/StartRound_1830.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** StartRound_1830.java 22 Nov 2009 14:28:49 -0000 1.24 --- StartRound_1830.java 23 Nov 2009 18:32:45 -0000 1.25 *************** *** 306,315 **** } else { // More than one left: find next bidder ! ! //auctionItem.setBid(-1, player); ! // That was incorrect: passing players may still bid. ! // But often they won't, or don't have the money. ! // TODO Need autopass facility, and skipping of turns if no money ! setNextBiddingPlayer(auctionItem, getCurrentPlayerIndex()); --- 306,315 ---- } else { // More than one left: find next bidder ! ! if (GameOption.OPTION_VALUE_YES.equalsIgnoreCase(getGameOption("LeaveAuctionOnPass"))) { ! // Game option: player to leave auction after a pass (default no). ! auctionItem.setBid(-1, player); ! } ! setNextBiddingPlayer(auctionItem, getCurrentPlayerIndex()); Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** PublicCompany.java 2 Nov 2009 23:30:36 -0000 1.71 --- PublicCompany.java 23 Nov 2009 18:32:45 -0000 1.72 *************** *** 1793,1797 **** public boolean canLoan() { ! return maxNumberOfLoans > 0; //TODO Does not work?? (see ORPanel) } --- 1793,1797 ---- public boolean canLoan() { ! return maxNumberOfLoans != 0; } Index: Round.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/Round.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Round.java 7 Oct 2009 19:00:38 -0000 1.27 --- Round.java 23 Nov 2009 18:32:44 -0000 1.28 *************** *** 116,119 **** --- 116,122 ---- } + public String getGameOption (String name) { + return gameManager.getGameOption(name); + } /* * (non-Javadoc) Index: GameOption.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GameOption.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GameOption.java 15 Jan 2009 20:53:28 -0000 1.7 --- GameOption.java 23 Nov 2009 18:32:45 -0000 1.8 *************** *** 18,21 **** --- 18,24 ---- new HashMap<String, GameOption>(); + public static final String OPTION_VALUE_YES = "yes"; + public static final String OPTION_VALUE_NO = "no"; + public static final String NUMBER_OF_PLAYERS = "numberOfPlayers"; Index: GamesInfo.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/GamesInfo.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GamesInfo.java 4 Jun 2008 19:00:32 -0000 1.7 --- GamesInfo.java 23 Nov 2009 18:32:45 -0000 1.8 *************** *** 1,4 **** /** ! * This is a singleton class that encapsulates the static game info * contained in data/Games.xml. * This information is available through a number of getters. --- 1,4 ---- /** ! * This is a singleton class that encapsulates the static game info * contained in data/Games.xml. * This information is available through a number of getters. *************** *** 6,13 **** package rails.game; ! import java.util.ArrayList; ! import java.util.HashMap; ! import java.util.List; ! import java.util.Map; import rails.util.Tag; --- 6,10 ---- package rails.game; ! import java.util.*; import rails.util.Tag; *************** *** 16,20 **** /** * @author Erik Vos ! * */ public class GamesInfo { --- 13,17 ---- /** * @author Erik Vos ! * */ public class GamesInfo { *************** *** 63,66 **** --- 60,64 ---- myGamesXmlFile = GAMES_XML; } + System.out.println("Loading games list from "+myGamesXmlFile); List<String> directories = new ArrayList<String>(); |