using System;
using System.Reflection;

namespace MonoGame.FourEngine
{
    public sealed class EntryPoint
    {
        public static void Run<T>(Action<IFourEngineGame> configureGame = null)
            => Run(new[]
            {
                typeof(T).GetTypeInfo().Assembly
            }, configureGame);

        public static void Run<T1, T2>(Action<IFourEngineGame> configureGame = null)
            => Run(new[]
            {
                typeof(T1).GetTypeInfo().Assembly,
                typeof(T2).GetTypeInfo().Assembly
            }, configureGame);

        public static void Run(Assembly[] assemblies, Action<IFourEngineGame> configureGame = null)
        {
            var game = new FourEngineGame(assemblies);
            configureGame?.Invoke(game);
            game.Run();
        }
    }
}