Update of /cvsroot/rails/18xx/rails/game
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4699/rails/game
Modified Files:
Portfolio.java Player.java
Log Message:
Player worth is now recalculated at every certificate move (bug fix)
Index: Portfolio.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/Portfolio.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** Portfolio.java 5 Nov 2009 22:50:37 -0000 1.40
--- Portfolio.java 5 Jan 2010 20:55:31 -0000 1.41
***************
*** 147,150 ****
--- 147,153 ----
getShareModel(certificate.getCompany()).addShare(certificate.getShare());
+ if (owner instanceof Player) {
+ ((Player)owner).updateWorth();
+ }
}
***************
*** 175,178 ****
--- 178,184 ----
getShareModel(certificate.getCompany()).addShare(
-certificate.getShare());
+ if (owner instanceof Player) {
+ ((Player)owner).updateWorth();
+ }
}
Index: Player.java
===================================================================
RCS file: /cvsroot/rails/18xx/rails/game/Player.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Player.java 17 Nov 2009 19:31:25 -0000 1.22
--- Player.java 5 Jan 2010 20:55:32 -0000 1.23
***************
*** 97,100 ****
--- 97,104 ----
}
+ public void updateWorth () {
+ worth.update();
+ }
+
public CertCountModel getCertCountModel() {
return certCount;
|