using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.FourEngine;
using System.Linq;

namespace LeMangeurDEnfants.Core
{
    public class Configuration
    {
        public static Point InnerResolution { get; private set; }
        public static readonly int VisualScale = 2;
        
        public static void Apply(IFourEngineGame game)
        {
            var modes = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.ToList();
            var bestMode = modes.OrderByDescending(x => x.Width * x.Height).FirstOrDefault();
            if (bestMode != null)
            {
                game.Resolution = new Point(
                    bestMode.Width,
                    bestMode.Height);
            }
            InnerResolution = new Point(320, 240);
            game.Resolution = InnerResolution * new Point(VisualScale);
            game.TargetFps = 60;
        }
    }
}