Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                Log("Client started " + args[0]);
                var punterName = args[0];
                var server     = args.Length > 1 ? args[1] : "localhost";
                var port       = args.Length > 2 ? args[2] : "7777";
                var isKonturRu = args.Length > 3;

                if (isKonturRu)
                {
                    var interaction = new OnlineInteraction(int.Parse(port));
                    interaction.Start();
                    interaction.RunGame((IAi)UberfullessnessAi.All.FirstOrDefault(
                                            x => x.Name ==
                                            "FutureIsNowSetupStrategyoptions-FutureIsNowStrategyoptions-ExtendComponentStrategyoptions-SumGreedyStrategyUberAi") ??
                                        new ConnectClosestMinesAi());
                    return;
                }

                var punter = PunterFactory.Create(punterName);
                var client = new OnlineClient(punter);
                client.Start(server, port);
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Log("Error:" + e);
                throw;
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var punterName = args[0];

            var punter = PunterFactory.Create(punterName);
            var log    = new ConsoleLog();
            var client = new OnlineClient(punter, log);

            client.Start();
            Console.ReadLine();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            try
            {
                Log("Client started " + args[0]);
                var punterName = args[0];
                var server     = args.Length > 1 ? args[1] : "localhost";
                var port       = args.Length > 2 ? args[2] : "7777";

                var punter = PunterFactory.Create(punterName);
                var client = new OnlineClient(punter);
                client.Start(server, port);
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Log("Error:" + e);
                throw;
            }
        }