Exemplo n.º 1
0
 /// <summary>
 /// Initialzes the Game.
 /// </summary>
 /// <param name="sceneManager">The Mogre SceneManager.</param>
 /// <param name="camera">The game CameraMan for the MouseControl.</param>
 /// <param name="mWindow">The RednerWindow for sending the width and height of the window.</param>
 /// <param name="mouse">The Mogre Mouse for GUI.</param>
 /// <param name="keyboard">The Mogre Keyboard for GUI.</param>
 /// <returns>Returns initializes Game singleton instance.</returns>
 private Game(SceneManager sceneManager, CameraMan camera, RenderWindow mWindow, Mouse mouse, Keyboard keyboard)
 {
     sceneMgr = sceneManager;
     gameObjectMgr = GameObjectManager.GetInstance();
     gameGUI = new MyGUI((int)mWindow.Width, (int)mWindow.Height, mouse, keyboard);
     mouseControl = MouseControl.GetInstance(camera, (int)mWindow.Width, (int)mWindow.Height);
     paused = true;
     soundPlayer = new SoundPlayer(mWindow);
     mission = new Mission();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Serializes the current Mission (all current ITargets).
 /// </summary>
 /// <param name="rootElement">The parent element.</param>
 /// <param name="mission">The serializing Mission with all current targets.</param>
 private void SerializeMission(XElement rootElement, Mission mission)
 {
     var element = new XElement("missionTargets");
     rootElement.Add(element);
     foreach (var target in mission.GetTargets()) {
         SerializeITarget(element, target);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Destroys the current Mission and initializes new empty game contol objets.
 /// </summary>
 public static void DestroyMission()
 {
     gameGUI.ClearMissionData();
     gameGUI.Enable = false;
     paused = true;
     mission = new Mission();
     gameObjectMgr.DestroyGame();
     initialized = false;
 }