<commit_before>using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;

using MysticChronicles.Engine.Common;
using MysticChronicles.Engine.Objects.Common;
using MysticChronicles.Engine.GameStates;
using MysticChronicles.Engine.Managers;

namespace MysticChronicles.Engine
{
    public class MainGame : Microsoft.Xna.Framework.Game
    {
        private SpriteBatch _spriteBatch;
        
        private BaseGameState _currentGameState;

        private GameStateContainer _gsContainer;

        private readonly GraphicsDeviceManager _graphics;

        public MainGame()
        {
            _graphics = new GraphicsDeviceManager(this);

            _graphics.PreparingDeviceSettings += _graphics_PreparingDeviceSettings;
            
            Content.RootDirectory = "Content";
        }

        private void _graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
        {
#if DEBUG
            _graphics.IsFullScreen = false;
#else
            _graphics.IsFullScreen = true;
#endif
            _graphics.PreferredBackBufferWidth = Constants.RESOLUTION_WIDTH;
            _graphics.PreferredBackBufferHeight = Constants.RESOLUTION_HEIGHT;
            _graphics.GraphicsProfile = GraphicsProfile.HiDef;
            _graphics.PreferMultiSampling = true;
            _graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;            
        }

        protected override void Initialize()
        {
            Window.Title = Common.Constants.GAME_NAME;

            _gsContainer = new GameStateContainer
            {
                Window_Height = Window.ClientBounds.Height,
                Window_Width = Window.ClientBounds.Width,
                TManager = new TextureManager(Content),
                MainFont = Content.Load<SpriteFont>("Main")
            };
            
            base.Initialize();
        }
        
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            
            _currentGameState = new MainMenuState(_gsContainer);

            _currentGameState.OnRequestStateChange += CurrentGameState_OnRequestStateChange;<commit_msg>Change: Updated the MainGame class to be completely decoupled from the game<commit_after>using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;

using MysticChronicles.Engine.Common;
using MysticChronicles.Engine.Objects.Common;
using MysticChronicles.Engine.GameStates;
using MysticChronicles.Engine.Managers;

namespace MysticChronicles.Engine
{
    public class MainGame : Microsoft.Xna.Framework.Game
    {
        private SpriteBatch _spriteBatch;
        
        private BaseGameState _currentGameState;

        private GameStateContainer _gsContainer;

        private readonly GraphicsDeviceManager _graphics;

        private readonly Type _initialGameState;

        public MainGame(string gameName, Type initialGameState)
        {
            Window.Title = gameName;
            _initialGameState = initialGameState;

            _graphics = new GraphicsDeviceManager(this);

            _graphics.PreparingDeviceSettings += _graphics_PreparingDeviceSettings;
            
            Content.RootDirectory = "Content";
        }
        
        private void _graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
        {
#if DEBUG
            _graphics.IsFullScreen = false;
#else
            _graphics.IsFullScreen = true;
#endif
            _graphics.PreferredBackBufferWidth = Constants.RESOLUTION_WIDTH;
            _graphics.PreferredBackBufferHeight = Constants.RESOLUTION_HEIGHT;
            _graphics.GraphicsProfile = GraphicsProfile.HiDef;
            _graphics.PreferMultiSampling = true;
            _graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;            
        }

        protected override void Initialize()
        {
            _gsContainer = new GameStateContainer
            {
                Window_Height = Window.ClientBounds.Height,
                Window_Width = Window.ClientBounds.Width,
                TManager = new TextureManager(Content),
                MainFont = Content.Load<SpriteFont>("Main")
            };
            
            base.Initialize();
        }
        
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _currentGameState = (BaseGameState)Activator.CreateInstance(_initialGameState, _gsContainer);

            _currentGameState.OnRequestStateChange += CurrentGameState_OnRequestStateChange;
{'fraction_non_alphanumeric': 0.06217829936174593, 'fraction_numerical': 0.0, 'mean_word_length': 2.53566229985444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2125163', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1168, 'n_words': 221}