Esempio n. 1
0
 /// <summary>
 /// Crashes game. If <see cref="GameCrashHandler.ThrowMessageToUser"/> true, throws message and exits from application, else just exits from application
 /// </summary>
 /// <param name="exception"><see cref="Exception"/> that crashed game</param>
 /// <param name="messageTitle">Message title</param>
 /// <param name="messageIcon">Message icon</param>
 public void Crash(Exception exception, string messageTitle = "craftersmine GameEngine - Game was crashed!", MessageBoxIcon messageIcon = MessageBoxIcon.Error)
 {
     this.exception = exception;
     GameApplication.LogException(this.exception);
     if (ThrowMessageToUser)
     {
         ThrowToUser(messageTitle, messageIcon);
     }
     GameApplication.Exit(0);
 }
Esempio n. 2
0
 /// <summary>
 /// Calls at game exit
 /// </summary>
 public virtual void OnExit()
 {
     GameApplication.Exit(0);
 }