Update of /cvsroot/rails/18xx/rails/game
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25235/rails/game
Modified Files:
City.java
Log Message:
'relatedStation' converted into a State object
Index: City.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/City.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** City.java 11 Apr 2010 15:49:47 -0000 1.11
--- City.java 18 Apr 2010 15:08:57 -0000 1.12
***************
*** 8,11 ****
--- 8,12 ----
import rails.game.move.Moveable;
+ import rails.game.state.GenericState;
import rails.util.Util;
***************
*** 29,33 ****
private int number;
private String uniqueId;
! private Station relatedStation;
private int slots;
private ArrayList<TokenI> tokens;
--- 30,35 ----
private int number;
private String uniqueId;
! //private Station relatedStation;
! private GenericState<Station> relatedStation;
private int slots;
private ArrayList<TokenI> tokens;
***************
*** 41,50 ****
this.mapHex = mapHex;
this.number = number;
! this.relatedStation = station;
!
uniqueId = mapHex.getName() + "_" + number;
! slots = relatedStation.getBaseSlots();
! tokens = new ArrayList<TokenI>(slots);
}
--- 43,53 ----
this.mapHex = mapHex;
this.number = number;
!
uniqueId = mapHex.getName() + "_" + number;
! relatedStation = new GenericState<Station>("City_"+uniqueId+"_station", station);
! setRelatedStation(station);
!
! tokens = new ArrayList<TokenI>(4);
}
***************
*** 66,74 ****
public Station getRelatedStation() {
! return relatedStation;
}
public void setRelatedStation(Station relatedStation) {
! this.relatedStation = relatedStation;
trackEdges =
mapHex.getConnectionString(mapHex.getCurrentTile(),
--- 69,78 ----
public Station getRelatedStation() {
! return relatedStation.getObject();
}
public void setRelatedStation(Station relatedStation) {
! this.relatedStation.set(relatedStation);
! slots = relatedStation.getBaseSlots();
trackEdges =
mapHex.getConnectionString(mapHex.getCurrentTile(),
|