Exemple #1
0
        public static void Main(string[] args)
        {
            Console.WindowWidth = 84;
            if (args != null & args.Length > 0 && args[0] == "clear")
            {
                var settings = new ArenaAppConfigSettings();
                var data = ArenaData.Load(settings.DataFile);
                foreach (var team in data.Teams)
                {
                    team.Clear();
                }
                data.Save(settings.DataFile);
            }
            while (true)
            {
                try
                {
                    var arena = new Program();

                    while (true)
                    {
                        arena.Run();
                    }
                }
                catch (Exception x)
                {
                    ConsoleX.WriteError("Arena crashed: {0}", x);
                    Console.ReadLine();
                }
            }
        }
Exemple #2
0
        public Program()
        {
            ConsoleX.WriteHeader();

            var settings = new ArenaAppConfigSettings();
            var data = ArenaData.Load(settings.DataFile);

            foreach (var file in settings.EngineDirectory.GetFiles("*.dll"))
            {
                try
                {
                    var assembly = Assembly.LoadFile(file.FullName);
                    data.AddOrUpdate(assembly);
                }
                catch (Exception x)
                {
                    ConsoleX.WriteWarning("Loading Assembly failed: {0}", x.Message);
                }
            }

            Init(settings, data);
        }