From: Stefan F. <ste...@us...> - 2010-03-12 07:29:22
|
Update of /cvsroot/rails/18xx/rails/common In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18772/rails/common Modified Files: GuiHints.java Log Message: CurrentRoundType and activePanel changed to state-type variables to allow undo between different round types. Index: GuiHints.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/common/GuiHints.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GuiHints.java 31 Jan 2010 22:22:27 -0000 1.2 --- GuiHints.java 12 Mar 2010 07:29:10 -0000 1.3 *************** *** 5,9 **** --- 5,13 ---- import java.util.List; + import rails.game.GameDef; import rails.game.RoundI; + import rails.game.move.StateChange; + import rails.game.state.EnumState; + import rails.game.state.GenericState; /** *************** *** 20,24 **** /** What round type is currently active in the engine? */ ! private Class<? extends RoundI> currentRoundType = null; /** Which windows should be visible? */ --- 24,28 ---- /** What round type is currently active in the engine? */ ! private GenericState<Class<? extends RoundI>> currentRoundType = null; /** Which windows should be visible? */ *************** *** 26,37 **** /** Which window type is active and should be on top? */ ! private GuiDef.Panel activePanel; public Class<? extends RoundI> getCurrentRoundType() { ! return currentRoundType; } public void setCurrentRoundType(Class<? extends RoundI> currentRoundType) { ! this.currentRoundType = currentRoundType; } --- 30,45 ---- /** Which window type is active and should be on top? */ ! private EnumState<GuiDef.Panel> activePanel = null; public Class<? extends RoundI> getCurrentRoundType() { ! return currentRoundType.getObject(); } public void setCurrentRoundType(Class<? extends RoundI> currentRoundType) { ! if (this.currentRoundType == null) ! this.currentRoundType = new GenericState<Class<? extends RoundI>> ! ("CurrentRoundType", currentRoundType); ! else ! new StateChange(this.currentRoundType, currentRoundType); } *************** *** 56,64 **** public GuiDef.Panel getActivePanel() { ! return activePanel; } public void setActivePanel(GuiDef.Panel activePanel) { ! this.activePanel = activePanel; } --- 64,75 ---- public GuiDef.Panel getActivePanel() { ! return (GuiDef.Panel)activePanel.getObject(); } public void setActivePanel(GuiDef.Panel activePanel) { ! if (this.activePanel == null) ! this.activePanel = new EnumState<GuiDef.Panel>("ActivePanel", activePanel); ! else ! new StateChange(this.activePanel, activePanel); } |