コード例 #1
0
ファイル: Program.cs プロジェクト: skallet/CubeWorld
        static int Main(string[] args)
        {
            /* TESTY
            //Server.Server server = new Server.Server();
            double width = 0;
            for (int i = 4; i < 12; i++)
            {
                width = Math.Pow((double)2, (double)i);

                Program.treeTest((int)width);
                Program.treeTest2((int)width);
            }

            Console.WriteLine("press key to exit");
            Console.ReadKey();
             */

            /* World testy + implementace
            Program.WorldTestBlock(16, 2);
            Console.ReadKey();
             */

            /*Program.WorldDataTest(16, 5);

            Console.ReadKey();

            /* MultiThreading world test
            var numThreads = 10;
            var countdownEvent = new CountdownEvent(numThreads);

            // Start workers.
            for (var i = 0; i < numThreads; i++)
            {
                new Thread(delegate()
                {
                    Program.WorldTest(16, 1);
                    // Signal the CountdownEvent.
                    countdownEvent.Signal();
                }).Start();
            }

            // Wait for workers.
            countdownEvent.Wait();
            Console.WriteLine("Finished.");
            Console.ReadKey();
             * */

            /* World size testy
            for (int i = 10; i < 11; i ++)
            {
                Program.WorldSizeTest(256, 10 * i);
                Console.WriteLine("Finish {0}", i * 10);
                //Console.ReadKey();
            }

            Console.WriteLine("Finish all");
            Console.ReadKey();
             */

            Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e)
            {
                Trees.QuadTree.QuadTree<Map.Block>.freeAllTree();
            };

            AppDomain.CurrentDomain.ProcessExit += ProcessExitHandler;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            Console.WriteLine("> Optimal tree size test:");
            Tests.OptimalTreeSize ots = new Tests.OptimalTreeSize(16, 1, 128, 10);
            //ots.Run();

            Server.Server server = new Server.Server();
            return 0;
        }
コード例 #2
0
ファイル: Client.cs プロジェクト: skallet/CubeWorld
 public Client(Server Server, HttpListenerContext Context)
 {
     context = Context;
     server = Server;
     generator.Generate();
 }