Example #1
0
        public void doChangeState()
        {
            if (currentState != null)
                currentState.exit();

            currentState = nextState;
            currentState.enter();

            nextState = null;
        }
Example #2
0
 public void changeState(EditorState newState)
 {
     nextState = newState;
     selectButton();
     myEditorControl.Focus();
 }
Example #3
0
 private void buttonSaveLevel_Click(object sender, EventArgs e)
 {
     EditorHelper.Instance.saveLevelToXML(lastLoadedLevel);
     currentState = null;
 }
Example #4
0
 private void buttonSaveLevelAs_Click(object sender, EventArgs e)
 {
     string fileName = "";
     if (openDialog("Save level", ref fileName))
     {
         EditorHelper.Instance.saveLevelToXML(fileName);
         currentState = null;
     }
 }
Example #5
0
 private void buttonLoadLevel_Click(object sender, EventArgs e)
 {
     string fileName = "";
     if (openDialog("Load Level", ref fileName))
     {
         lastLoadedLevel = fileName;
         EditorHelper.Instance.loadNewLevel(fileName);
         currentState = null;
     }
 }
Example #6
0
 private void restartLevelButton_Click(object sender, EventArgs e)
 {
     //Reload level
     if (lastLoadedLevel != null)
     {
         EditorHelper.Instance.loadNewLevel(lastLoadedLevel);
         currentState = null;
     }
 }