An EngineStateChangeEvent is raised when some interesting change in state occurs such as an animal being born or dying or being teleported into your world or out. Its main purpose is to provide some useful feedback to the UI This EventArgs describes that event. It contains the type of state change and a short description and a long description
Inheritance: System.EventArgs
Beispiel #1
0
 /// <summary>
 ///  Helper function for the EngineStateChanged event to fire
 ///  the event given a new EngineStateChangedEventArgs
 /// </summary>
 /// <param name="e">Properties identifying the change to the engine.</param>
 public void OnEngineStateChanged(EngineStateChangedEventArgs e)
 {
     if (EngineStateChanged != null)
     {
         EngineStateChanged(null, e);
     }
 }
Beispiel #2
0
        //Handle state changes from the GameEngine
        private void EngineStateChanged(object sender, EngineStateChangedEventArgs ev)
        {
            switch (ev.StateChange)
            {
                case EngineStateChangeType.AnimalTeleported:
                    //this.topPanel.GameEventText = ev.ShortDescription;
                    engineStateText += ev.LongDescription + "\r\n";
                    break;

                case EngineStateChangeType.Other:
                    engineStateText += ev.LongDescription + "\r\n";
                    break;

                case EngineStateChangeType.DeveloperInformation:
                    if (traceEnabled && traceWindow != null)
                    {
                        traceWindow.DebugWriteLine(ev.ShortDescription);
                    }
                    break;
            }
        }