public void Start() { //int iii = 0; //OrderControl.Instance.Init(); //Action<DriverOrderCode> action = (DriverOrderCode order) => { iii++; }; //OrderControl.Instance.AddListener(action); //OrderControl.Instance.RemoveListener(action); //OrderControl.Instance.AddListener((DriverOrderCode order) => //{ // iii+=10000; // //throw new Exception(); //}); //OrderControl.Instance.AddListener(1,(DriverOrderCode order) => //{ // throw new Exception(); //}); //OrderControl.Instance.RemoveListener<DriverOrderCode>(1); //byte[] buffer; //DriverOrderCode orderCode = new DriverOrderCode(); //orderCode.index = 1; //orderCode.targer = 2; //orderCode.value = 3; //orderCode.vector = new IntVector2(4, 5); //buffer = orderCode.ToBytes(); //OrderControl.Instance.RunListener(buffer); //long t = TestTool.RunTime(() => //{ // for (int i = 0; i < 10000; i++) // { // OrderControl.Instance.RunListener(buffer); // } //}); //Console.WriteLine("[方法]" + t + "ms"); //throw new Exception(); //OrderCode order = new OrderCode(); //order.origin = 123; //order.vector = new IntVector2(1, 2); //order.value = 999; //order.targer = 33; //byte[] aaa = OrderControl.Instance.ReflectOrderToBytes(order); //byte[] bbb = order.ToBytes(); //long t = TestTool.RunTime(() => //{ // OrderCode o1 = OrderControl.Instance.ReflectBytesToOrder<OrderCode>(aaa); //}); //Console.WriteLine("[方法1]" + t + "ms"); //t = TestTool.RunTime(() => //{ // OrderCode o2; // for (int i = 0; i < 100; i++) // { // o2 = OrderControl.Instance.ReflectBytesToOrder<OrderCode>(bbb); // } //}); //Console.WriteLine("[方法2]" + t + "ms"); //t = TestTool.RunTime(() => //{ // OrderCode o3; // for (int i = 0; i < 100; i++) // { // o3 = new OrderCode(bbb); // } //}); //Console.WriteLine("[方法3]" + t + "ms"); EntityModel test = new EntityModel(); test.Id = "TestUnit"; test.name = "Test"; test.components = new List <EntityComponent>(); test.components.Add(new EntityController()); test.components.Add(new EntityDriver()); test.ToXml("./Base/Entity/Test/Test.xml", "TestUnit"); //test.ToXml("D:/Program/ServerRuntimeProject/ServerRuntimeCmd/ServerRuntimeCmd/bin/Debug/Base/Entity/Test/Test.xml", "TestUnit"); EntityModel a = test.Clone(); EntityModel b = test.Clone(); ((EntityDriver)a.components[1]).count = 888; ((EntityDriver)b.components[1]).count = 777; BufferData data = new BufferData(); data.entitys = new KeyValuePair <int, EntityModel>[2] { new KeyValuePair <int, EntityModel>(123, a), new KeyValuePair <int, EntityModel>(456, b) }; data.ToXml("./EntityCache.xml", "null"); netFSM = new NetFSM(); netFSM.Init(); gameFSM = new GameFSM(); gameFSM.Init(); }