From: Erik V. <ev...@us...> - 2008-11-15 13:42:33
|
Update of /cvsroot/rails/18xx/rails/game In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7577/rails/game Modified Files: PublicCompanyI.java PublicCompany.java Log Message: Added destination reached condition Index: PublicCompany.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompany.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** PublicCompany.java 2 Nov 2008 20:04:26 -0000 1.41 --- PublicCompany.java 15 Nov 2008 13:42:27 -0000 1.42 *************** *** 56,59 **** --- 56,60 ---- /** Destination hex * */ protected MapHex destinationHex = null; + protected BooleanState hasReachedDestination = null; /** Sequence number in the array of public companies - may not be useful */ *************** *** 278,281 **** --- 279,283 ---- if (hex != null) { destinationHex = hex; + hasReachedDestination = new BooleanState (name+"_reachedDestination", false); } else { throw new ConfigurationException("Invalid destination hex " *************** *** 698,701 **** --- 700,716 ---- return destinationHex; } + + public boolean hasDestination () { + return destinationHex != null; + } + + public boolean hasReachedDestination() { + return hasReachedDestination != null && + hasReachedDestination.booleanValue(); + } + + public void setReachedDestination (boolean value) { + hasReachedDestination.set(value); + } /** Index: PublicCompanyI.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/PublicCompanyI.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PublicCompanyI.java 2 Nov 2008 20:04:26 -0000 1.23 --- PublicCompanyI.java 15 Nov 2008 13:42:27 -0000 1.24 *************** *** 329,333 **** public MapHex getDestinationHex(); ! public int getNumberOfTileLays(String tileColour); --- 329,336 ---- public MapHex getDestinationHex(); ! public boolean hasDestination (); ! public boolean hasReachedDestination(); ! public void setReachedDestination (boolean value); ! public int getNumberOfTileLays(String tileColour); |