Пример #1
0
        public void Init(GraphicsDevice device,
            ContentManager content,
            GraphicObjectManager graphicObjMgr,
            Renderer renderer)
        {
            mSelectionManager.Init(renderer.GetCamera(), graphicObjMgr.GetList());
              mSound.Init(content);
              graphicObjMgr.SetSoundRef(mSound);

              mGom = GameObjectManager.GetInstance();

              mDevice = device;
              mRenderer = renderer;
              mCamera = mRenderer.GetCamera();

              mInput.Init();
              mInput.SetKey(new KeyAssignment(Keys.Escape, MenuSwitch));

              mInput.SetKey(new KeyAssignment(Keys.F1, ShowHelpScreen));
              mInput.SetKey(new KeyAssignment(Keys.F2, ShowStatsScreen));

              mInput.SetKey(new KeyAssignment(Keys.F4, LoadGame));
              mInput.SetKey(new KeyAssignment(Keys.F5, SaveGame));

              mInput.SetKey(new KeyAssignment(Keys.LeftControl, LeftControlHelper));
              mInput.SetKey(new KeyAssignment(Keys.RightControl, mSelectionManager.SetMultiSelection));
              mInput.SetKey(new KeyAssignment(Keys.LeftShift, ShiftClickHelper));

              mInput.SetKey(new KeyAssignment(Keys.W, mCamera.MoveCameraUp, false));
              mInput.SetKey(new KeyAssignment(Keys.A, mCamera.MoveCameraLeft, false));
              mInput.SetKey(new KeyAssignment(Keys.S, mCamera.MoveCameraDown, false));
              mInput.SetKey(new KeyAssignment(Keys.D, mCamera.MoveCameraRight, false));
              mInput.SetKey(new KeyAssignment(Keys.OemPlus, mCamera.ZoomIn, false));
              mInput.SetKey(new KeyAssignment(Keys.OemMinus, mCamera.ZoomOut, false));

              mInput.SetKey(new KeyAssignment(Keys.X, mInput.SetHotkey, 0)); // StarFleet/Interceptor
              mInput.SetKey(new KeyAssignment(Keys.C, mInput.SetHotkey, 1)); // MinionBoost/Predator
              mInput.SetKey(new KeyAssignment(Keys.V, mInput.SetHotkey, 2)); // Satelite/Defender
              mInput.SetKey(new KeyAssignment(Keys.B, mInput.SetHotkey, 3)); // Shield
              mInput.SetKey(new KeyAssignment(Keys.N, mInput.SetHotkey, 4)); // Deathstar

              mInput.SetKey(new KeyAssignment(Keys.F10, mRenderer.ToggleFogOfWar));
        }
Пример #2
0
 public void Init(List<GameObject> objList)
 {
     mObjectList = objList;
       mGraphicObjectManager = GraphicObjectManager.GetInstance();
       mGameObjectFactory = new GameObjectFactory(mObjectList, mGraphicObjectManager);
       mStats = new Stats();
 }
Пример #3
0
 public GameObjectFactory(List<GameObject> gameObjects, GraphicObjectManager graphicObjectManager)
 {
     mGameObjects = gameObjects;
       mGraphicObjectManager = graphicObjectManager;
 }
Пример #4
0
 public static GraphicObjectManager GetInstance()
 {
     return sUniqueInstance ?? (sUniqueInstance = new GraphicObjectManager());
 }
Пример #5
0
        /// <summary>
        /// Initializes the human game view
        /// </summary>
        /// <param name="graphics"></param>
        /// <param name="content"> </param>
        public void Init(GraphicsDeviceManager graphics, ContentManager content)
        {
            if (!mInitialized)
              {
            mGraphics = graphics;

            mGraphicObjectManager = GraphicObjectManager.GetInstance();
            mGraphicObjectManager.Init(content);

            mRenderer = new Renderer();
            mRenderer.Init(graphics, mGraphicObjectManager.GetList(), content);

            mUserActionProc = new UserActionProcessor();
            mUserActionProc.Init(graphics.GraphicsDevice, content, mGraphicObjectManager, mRenderer);

            mInterface = new Interface();
            mInterface.Init(new SpriteBatch(graphics.GraphicsDevice), mRenderer, content, mUserActionProc);

            mUserActionProc.SetInterface(mInterface);

            mInitialized = true;
              }
        }