From: Erik V. <ev...@us...> - 2009-09-25 19:13:11
|
Update of /cvsroot/rails/18xx/rails/game/action In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5549/rails/game/action Modified Files: PossibleActions.java StartCompany.java Log Message: Rationalised Bank, removing statics Removed two unnecessary Util methods Index: PossibleActions.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/PossibleActions.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PossibleActions.java 4 Jun 2008 19:00:29 -0000 1.13 --- PossibleActions.java 25 Sep 2009 19:13:01 -0000 1.14 *************** *** 11,16 **** import org.apache.log4j.Logger; - import rails.util.Util; - /** * This class manages the actions that the current user can execute at any point --- 11,14 ---- *************** *** 20,24 **** * instances lingering around, as there can only be one set of possible actions * at any point in time. ! * * @author Erik Vos */ --- 18,22 ---- * instances lingering around, as there can only be one set of possible actions * at any point in time. ! * * @author Erik Vos */ *************** *** 64,68 **** public boolean contains(Class<? extends PossibleAction> clazz) { for (PossibleAction action : possibleActions) { ! if (Util.isInstanceOf(action, clazz)) return true; } return false; --- 62,66 ---- public boolean contains(Class<? extends PossibleAction> clazz) { for (PossibleAction action : possibleActions) { ! if (clazz.isAssignableFrom(action.getClass())) return true; } return false; *************** *** 73,77 **** List<T> result = new ArrayList<T>(); for (PossibleAction action : possibleActions) { ! if (Util.isInstanceOf(action, clazz)) result.add((T) action); } return result; --- 71,75 ---- List<T> result = new ArrayList<T>(); for (PossibleAction action : possibleActions) { ! if (clazz.isAssignableFrom(action.getClass())) result.add((T) action); } return result; Index: StartCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/action/StartCompany.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StartCompany.java 30 Oct 2008 21:48:20 -0000 1.7 --- StartCompany.java 25 Sep 2009 19:13:01 -0000 1.8 *************** *** 13,17 **** public StartCompany(PublicCertificateI certificate, int[] prices, int maximumNumber) { ! super(certificate, Bank.getIpo(), 0, maximumNumber); this.startPrices = prices.clone(); } --- 13,17 ---- public StartCompany(PublicCertificateI certificate, int[] prices, int maximumNumber) { ! super(certificate, Bank.getInstance().getIpo(), 0, maximumNumber); this.startPrices = prices.clone(); } *************** *** 23,27 **** public StartCompany(PublicCertificateI certificate, int price, int maximumNumber) { ! super(certificate, Bank.getIpo(), 0, maximumNumber); this.price = price; } --- 23,27 ---- public StartCompany(PublicCertificateI certificate, int price, int maximumNumber) { ! super(certificate, Bank.getInstance().getIpo(), 0, maximumNumber); this.price = price; } |