//Konstruktor; laddar gränssnitt & bilder
 public ScreenView(SpriteBatch a_spriteBatch, View.AnimationSystem a_animationSystem, View.InputHandler a_inputHandler, View.SoundHandler a_soundHandler)
 {
     this.m_spriteBatch  = a_spriteBatch;
     this.m_animationSys = a_animationSystem;
     this.m_inputHandler = a_inputHandler;
     this.m_soundHandler = a_soundHandler;
 }
示例#2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="spriteBatch">SpriteBatch instance</param>
        /// <param name="gameModel">GameModel instance</param>
        /// <param name="animationSystem">AnimationSystem instance</param>
        /// <param name="inputHandler">InputHandler instance</param>
        /// <param name="soundHandler">SoundHandler instance</param>
        public ScreenView(SpriteBatch spriteBatch, View.AnimationSystem animationSystem, View.InputHandler inputHandler, View.SoundHandler soundHandler)
        {
            this._spriteBatch  = spriteBatch;
            this._animationSys = animationSystem;
            this._inputHandler = inputHandler;
            this._soundHandler = soundHandler;

            this._screenContent = new Content();
            this._stopWatch     = new Stopwatch();
            this.FullScreen     = false;
        }
示例#3
0
 public GameView(GraphicsDevice a_graphicsDevice, SpriteBatch a_spriteBatch, Model.GameModel a_gameModel, View.AnimationSystem a_animationSystem, View.InputHandler a_inputHandler, View.SoundHandler a_soundHandler)
 {
     this.m_gameModel       = a_gameModel;
     this.m_camera          = new Camera(a_graphicsDevice, a_gameModel);
     this.m_spriteBatch     = a_spriteBatch;
     this.m_soundHandler    = a_soundHandler;
     this.m_inputHandler    = a_inputHandler;                                                                                        //Hantering av samtliga anv-inputs
     this.m_animationSystem = a_animationSystem;                                                                                     //System för sprite-animationer
     this.m_conversation    = new Conversation(m_spriteBatch, m_gameModel, m_camera, m_inputHandler);                                //Behandlar/ritar dialogtexter
     this.m_UIView          = new UIView(m_spriteBatch, m_camera, m_inputHandler, a_gameModel, m_conversation);                      //Utritning av user-interface
     this.m_unitView        = new UnitView(m_gameModel, m_spriteBatch, m_camera, m_inputHandler, m_animationSystem, m_conversation); //Utritning av samtliga units
 }
示例#4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="graphicsDevice">GraphicsDevice instance</param>
 /// <param name="spriteBatch">SpriteBatch instance</param>
 /// <param name="gameModel">GameModel instance</param>
 /// <param name="animationSystem">AnimationSystem instance</param>
 /// <param name="inputHandler">InputHandler instance</param>
 /// <param name="soundHandler">SoundHandler instance</param>
 public GameView(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Model.GameModel gameModel, View.AnimationSystem animationSystem, View.InputHandler inputHandler, View.SoundHandler soundHandler)
 {
     this._gameModel       = gameModel;
     this._camera          = new Camera(graphicsDevice, gameModel);
     this._spriteBatch     = spriteBatch;
     this._soundHandler    = soundHandler;
     this._inputHandler    = inputHandler;
     this._animationSystem = animationSystem;
     this._conversation    = new Dialog(spriteBatch, _gameModel, _camera, _inputHandler);
     this._UIView          = new UIView(spriteBatch, _camera, _inputHandler, gameModel, _conversation);
     this._unitView        = new UnitView(_gameModel, spriteBatch, _camera, _inputHandler, _animationSystem, _conversation);
 }
示例#5
0
        protected override void LoadContent()
        {
            m_spriteBatch = new SpriteBatch(GraphicsDevice);
            m_gameModel   = new Model.GameModel(Content);

            //Klasser som medskickas till samtliga controller-klasser
            m_inputHandler    = new View.InputHandler();
            m_animationSystem = new View.AnimationSystem(m_spriteBatch);
            m_soundHandler    = new View.SoundHandler(m_inputHandler);
            m_soundHandler.LoadContent(Content);

            //Controllers
            m_screenController = new ScreenController(m_gameModel, m_spriteBatch, m_animationSystem, m_inputHandler, m_soundHandler);
            m_gameController   = new GameController(GraphicsDevice, m_spriteBatch, m_gameModel, m_animationSystem, m_inputHandler, m_soundHandler);

            m_gameController.LoadContent(Content);
            m_screenController.LoadScreenContent(Content);

            //Initsierar renderingsobjekt för TMX filer(map-filer)
            Map.InitObjectDrawing(GraphicsDevice);
        }
        /// <summary>
        /// Loading game engine, controller and view.
        /// Loading all needed class instances.
        /// </summary>
        protected override void LoadContent()
        {
            _spriteBatch     = new SpriteBatch(GraphicsDevice);
            _performanceTool = new PerformanceUtility.PerformanceUtility(_graphics, this);
            _performanceTool.LoadContent(Content, _spriteBatch);
            _gameModel = new Model.GameModel(Content);

            //Classes needed for all controller classes (GameController and ScreenController)
            _inputHandler    = new View.InputHandler();
            _animationSystem = new View.AnimationSystem(_spriteBatch);
            _soundHandler    = new View.SoundHandler(_inputHandler);
            _soundHandler.LoadContent(Content);

            //Controllers
            _screenController = new ScreenController(_gameModel, _spriteBatch, _animationSystem, _inputHandler, _soundHandler);
            _gameController   = new GameController(GraphicsDevice, _spriteBatch, _gameModel, _animationSystem, _inputHandler, _soundHandler);

            _gameController.LoadContent(Content);
            _screenController.LoadScreenContent(Content);

            //Initializing renderingobject for TMX files (map-files).
            Map.InitObjectDrawing(GraphicsDevice);
        }
示例#7
0
 protected override void UnloadContent()
 {
     m_soundHandler = null;
     MediaPlayer.Stop();
     this.Content.Unload();
 }
示例#8
0
 //Konstruktor
 public GameController(GraphicsDevice a_graphicsDevice, SpriteBatch a_spriteBatch, Model.GameModel a_gameModel, View.AnimationSystem a_animationSystem, View.InputHandler a_inputHandler, View.SoundHandler a_soundHandler)
 {
     m_gameModel = a_gameModel;
     m_gameView  = new View.GameView(a_graphicsDevice, a_spriteBatch, m_gameModel, a_animationSystem, a_inputHandler, a_soundHandler);
 }
 public ScreenController(Model.GameModel a_gameModel, SpriteBatch a_spriteBatch, View.AnimationSystem a_animationSystem, View.InputHandler a_inputHandler, View.SoundHandler a_soundHandler)
 {
     this.m_gameModel   = a_gameModel;
     this.m_spriteBatch = a_spriteBatch;
     this.m_screenView  = new View.ScreenView(m_spriteBatch, a_animationSystem, a_inputHandler, a_soundHandler);
 }
示例#10
0
 /// <summary>
 /// Cinstructor
 /// </summary>
 /// <param name="graphicsDevice">GraphickDevice instance</param>
 /// <param name="spriteBatch">SpriteBatch instance</param>
 /// <param name="gameModel">GameModel instance</param>
 /// <param name="animationSystem">AnimationSystem instance</param>
 /// <param name="inputHandler">InputHandler instance</param>
 /// <param name="soundHandler">SoundHandler instance</param>
 public GameController(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, Model.GameModel gameModel,
                       View.AnimationSystem animationSystem, View.InputHandler inputHandler, View.SoundHandler soundHandler)
 {
     this._gameModel = gameModel;
     this._gameView  = new View.GameView(graphicsDevice, spriteBatch, _gameModel, animationSystem, inputHandler, soundHandler);
 }