//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
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="gameModel">GameModel instance</param>
 /// <param name="spriteBatch">SpriteBatch instance</param>
 /// <param name="camera">Camera instance</param>
 /// <param name="inputHandler">InputHandler instance</param>
 /// <param name="animationSystem">AnimationSystem instance</param>
 /// <param name="dialog">Dialog instance</param>
 public UnitView(Model.GameModel gameModel, SpriteBatch spriteBatch, Camera camera, InputHandler inputHandler, AnimationSystem animationSystem, View.Dialog dialog)
 {
     this._player              = gameModel.PlayerSystem.Player;
     this._enemies             = gameModel.EnemySystem.Enemies;
     this._deadEnemies         = gameModel.EnemySystem.SpawnList;
     this._nonPlayerCharacters = gameModel.NpcSystem.NonPlayerCharacters;
     this._questSystem         = gameModel.QuestSystem;
     this._camera              = camera;
     this._spriteBatch         = spriteBatch;
     this._inputHandler        = inputHandler;
     this._animationSystem     = animationSystem;
     this._conversation        = dialog;
 }
Пример #6
0
 public UnitView(Model.GameModel a_gameModel, SpriteBatch a_spriteBatch, Camera a_camera, InputHandler a_inputHandler, AnimationSystem a_animationSystem, View.Conversation a_conversation)
 {
     this.m_player          = a_gameModel.m_playerSystem.m_player;
     this.m_enemies         = a_gameModel.m_enemySystem.m_enemies;
     this.m_deadEnemies     = a_gameModel.m_enemySystem.m_spawnList;
     this.m_friends         = a_gameModel.m_friendSystem.m_friends;
     this.m_questSystem     = a_gameModel.m_questSystem;
     this.m_camera          = a_camera;
     this.m_spriteBatch     = a_spriteBatch;
     this.m_inputHandler    = a_inputHandler;
     this.m_animationSystem = a_animationSystem;
     this.m_conversation    = a_conversation;
 }
Пример #7
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);
        }
Пример #9
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);
 }
Пример #11
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);
 }