﻿using Autofac;
using PixelatedDesigns.Arena.Composition;
using System;
using System.Reflection;

namespace PixelatedDesigns.Arena.Sandbox
{
  class Program
  {
	static void Main(string[] args)
	{
	  Console.WriteLine("Arena Sandbox");
	  Console.WriteLine("Dev: Jacob Smith");
	  Console.WriteLine($"Version: {Assembly.GetEntryAssembly().GetName().Version}");

	  var options = new ContainerOptions
	  {
		ConnectionString = @"Data Source=.\sqlexpress;Initial Catalog=Arena;Integrated Security=True"
	  };

	  var containerBuilder = new ContainerInstaller(options).Install();
	  containerBuilder.RegisterType<SandBoxer>();

	  var container = containerBuilder.Build();

	  using (var scope = container.BeginLifetimeScope())
	  {
		var sandboxer = scope.Resolve<SandBoxer>();
		sandboxer.Execute();

	  }

	  Console.ReadKey();
	}
  }
}