From: Mark J S. <kr...@us...> - 2008-11-29 21:51:03
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32404/18xx/rails/game Modified Files: City.java Log Message: Corrected the hasTokenOf(PublicCompanyI company) to get the Company Name and call hasTokenOf(String companyName). The previous use of the tokens.contains(company) failed since the ArrayList is of TokenI's not PublicCompanyI's. Index: City.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/City.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** City.java 29 Nov 2008 20:01:33 -0000 1.5 --- City.java 29 Nov 2008 21:50:58 -0000 1.6 *************** *** 139,147 **** * @param company * @return true if this City already contains an instance of the specified ! * company's token. */ public boolean hasTokenOf(PublicCompanyI company) { ! if (tokens.contains(company)) return true; ! return false; } --- 139,148 ---- * @param company * @return true if this City already contains an instance of the specified ! * company's token. Do this by calling the hasTokenOf with Company Name. ! * Using a tokens.contains(company) fails since the tokens are a ArrayList ! * of TokenI not a ArrayList of PublicCompanyI. */ public boolean hasTokenOf(PublicCompanyI company) { ! return hasTokenOf (company.getName()); } |