/// <summary>
 /// Initializes MouseControl and stores CameraMan reference. 
 /// </summary>
 /// <param name="c">The reference to the game CameraMan.</param>
 /// <param name="sceneWidth">The width of the game window.</param>
 /// <param name="sceneHeight">The height of the game window.</param>
 /// <returns>Return initialized singleton instance.</returns>
 public static MouseControl GetInstance(CameraMan c, int sceneWidth, int sceneHeight)
 {
     if (instance == null) {
         instance = new MouseControl(c, sceneWidth, sceneHeight);
     }
     return instance;
 }
Exemple #2
0
 /// <summary>
 /// Initializes MouseControl and stores CameraMan reference.
 /// </summary>
 /// <param name="c">The reference to the game CameraMan.</param>
 /// <param name="sceneWidth">The width of the game window.</param>
 /// <param name="sceneHeight">The height of the game window.</param>
 /// <returns>Return initialized singleton instance.</returns>
 public static MouseControl GetInstance(CameraMan c, int sceneWidth, int sceneHeight)
 {
     if (instance == null)
     {
         instance = new MouseControl(c, sceneWidth, sceneHeight);
     }
     return(instance);
 }
Exemple #3
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();
 }