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