Example #1
0
 /// <summary>
 /// Calcs whether the snake crashed or not.
 /// </summary>
 /// <param name="position">The test position.</param>
 /// <returns></returns>
 private bool CrashTest(Position position)
 {
     IsCrashed = Body.Any(x => x.CurPosition.Equals(position));
     if (IsCrashed)
     {
         OnCrashed?.Invoke();
     }
     return(IsCrashed);
 }
Example #2
0
 public static void InvokeCrashed(CrashedEventArgs e)
 {
     OnCrashed?.Invoke(e);
 }
Example #3
0
 protected void TriggerCrashMessage()
 {
     m_StopWorking = true;
     OnCrashed?.Invoke(this, null);
 }