/// <summary> /// Initializes a new instance of a <see cref="T:RedBlueGames.LiteFSM.State`1"/>. /// </summary> /// <param name="ID">Identifier for the state.</param> /// <param name="enter">Enter callback.</param> /// <param name="exit">Exit callback.</param> /// <param name="update">Update callback.</param> public State(T ID, EnterMethod enter, ExitMethod exit, UpdateMethod update) { this.ID = ID; this.enter = enter; this.exit = exit; this.update = update; }
public State(T id, EnterMethod enter, ExitMethod exit, UpdateMethod update) { ID = id; _enter = enter; _exit = exit; _update = update; }
public State(T id, EnterMethod enterMethod, ExitMethod exitMethod, UpdateMethod updateMethod) { this.ID = id; this.enter += enterMethod; this.exit += exitMethod; this.update += updateMethod; }
public State(ExecuteMethod executeMethod, DecideMethod decideMethod, EnterMethod enterMethod, ExitMethod exitMethod) { this.executeMethod = executeMethod; this.decideMethod = decideMethod; this.enterMethod = enterMethod; this.exitMethod = exitMethod; }
/// <summary> /// Terminates the current process while reducing the risk of loosing any cached data. /// </summary> /// <remarks> /// Terminating the current process involves taking the following steps: /// - <see cref="OnProcessExit"/> is raised. /// - In case <see cref="ExitMethod.Request"/> is specified, <see cref="ExitRequestRaised"/> is raised. /// - In case <see cref="ExitMethod.Kill"/> is specified, the process is killed. /// </remarks> /// <param name="exitCode">The exit code to return to the operating system.</param> /// <param name="exitMethod">The method(s) to use for termination.</param> /// <returns>True if the current process' termination code is invoked, false otherwise.</returns> public static bool TerminateProcess(int exitCode, ExitMethod exitMethod) { Log.Message("Terminating process with exit code " + exitCode + "."); lock (_syncRoot) _onProcessExit(null, new EventArgs()); if ((exitMethod & ExitMethod.Request) == ExitMethod.Request && RaiseExitRequest(exitCode)) { return(true); } return((exitMethod & ExitMethod.Kill) == ExitMethod.Kill && KillProcess()); }
/// <summary> /// Terminates the current process while reducing the risk of loosing any cached data. /// </summary> /// <remarks> /// Terminating the current process involves taking the following steps: /// - <see cref="OnProcessExit"/> is raised. /// - In case <see cref="ExitMethod.Request"/> is specified, <see cref="ExitRequestRaised"/> is raised. /// - In case <see cref="ExitMethod.Kill"/> is specified, the process is killed. /// </remarks> /// <param name="exitCode">The exit code to return to the operating system.</param> /// <param name="exitMethod">The method(s) to use for termination.</param> /// <returns>True if the current process' termination code is invoked, false otherwise.</returns> public static bool TerminateProcess(int exitCode, ExitMethod exitMethod) { Log.Message("Terminating process with exit code " + exitCode + "."); lock (_syncRoot) _onProcessExit(null, new EventArgs()); if ((exitMethod & ExitMethod.Request) == ExitMethod.Request && RaiseExitRequest(exitCode)) return true; return (exitMethod & ExitMethod.Kill) == ExitMethod.Kill && KillProcess(); }
public virtual bool Visit(ExitMethod exitMethod) { return(true); }
private void NewGameButton_MouseClick(object sender, MouseEventArgs e) { this.zzzTheExitMethod = ExitMethod.NewGameButton; this.forme.Close(); }