From: Erik V. <ev...@us...> - 2009-09-25 19:13:16
|
Update of /cvsroot/rails/18xx/rails/game/state In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5549/rails/game/state Modified Files: State.java Log Message: Rationalised Bank, removing statics Removed two unnecessary Util methods Index: State.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/game/state/State.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** State.java 23 Sep 2009 21:38:57 -0000 1.10 --- State.java 25 Sep 2009 19:13:01 -0000 1.11 *************** *** 6,10 **** import rails.game.model.ModelObject; import rails.game.move.StateChange; - import rails.util.Util; public class State extends ModelObject implements StateI { --- 6,9 ---- *************** *** 30,34 **** if (object == null) { new Exception("NULL object not allowed in creating State wrapper").printStackTrace(); ! } else if (clazz != null && Util.isInstanceOf(object, clazz)) { new Exception("Object " + object + " must be instance of " + clazz).printStackTrace(); } else { --- 29,33 ---- if (object == null) { new Exception("NULL object not allowed in creating State wrapper").printStackTrace(); ! } else if (clazz != null && clazz.isAssignableFrom(object.getClass())) { new Exception("Object " + object + " must be instance of " + clazz).printStackTrace(); } else { *************** *** 41,45 **** if (object == null) { if (this.object != null) new StateChange(this, object); ! } else if (Util.isInstanceOf(object, clazz)) { if (!object.equals(this.object) || forced) new StateChange(this, object); --- 40,45 ---- if (object == null) { if (this.object != null) new StateChange(this, object); ! //} else if (Util.isInstanceOf(object, clazz)) { ! } else if (clazz.isAssignableFrom(object.getClass())) { if (!object.equals(this.object) || forced) new StateChange(this, object); |