Inheritance: MonoBehaviour
Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.R))
     {
         AAA.GetInstance();
     }
 }
Example #2
0
 public void R9()
 {
     Time = 200;//下一波攻擊時間
     MakeMonster("C1", new MONSTER7_C(new Vector2(0, 0)), 4);
     MakeMonster("C1", new MONSTER41_B(new Vector2(0, 0)), 5 + GamePage.HERO_S);
     AAA.firedM2();
 }
        public static void Main(string[] args)
        {
            string a = "ycoder";

            Console.WriteLine(a is object);
            A aa = new A();

            //Console.WriteLine(aa is A<>);//con't write code like this
            typeof(A <>).IsAssignableFrom(aa.GetType());            //return false

            Trace(typeof(object).IsAssignableFrom(typeof(string))); //true
            Trace(typeof(A <>).IsAssignableFrom(typeof(A)));        //false

            AAA aaa = new AAA();

            Trace("Use IsTypeOf:");
            Trace(IsTypeOf(aaa, typeof(A <>)));
            Trace(IsTypeOf(aaa, typeof(AA)));
            Trace(IsTypeOf(aaa, typeof(AAA <>)));

            Trace("Use IsAssignableFrom from stackoverflow - not right:");
            Trace(IsAssignableFrom(typeof(A), typeof(A <>)));            // error
            Trace(IsAssignableFrom(typeof(AA), typeof(A <>)));
            Trace(IsAssignableFrom(typeof(AAA), typeof(A <>)));

            Trace("Use IsAssignableToGenericType:");
            Trace(IsAssignableToGenericType(typeof(A), typeof(A <>)));
            Trace(IsAssignableToGenericType(typeof(AA), typeof(A <>)));
            Trace(IsAssignableToGenericType(typeof(AAA), typeof(A <>)));
        }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            excel.Application dosya = new excel.Application(); //excel acar
            dosya.Visible = true;                              //exceli gösterir
            object a = Type.Missing;

            excel.Workbook  kitap = dosya.Workbooks.Add(a);                     //calısma sayfası olusturur.
            excel.Worksheet sayfa = (excel.Worksheet)kitap.Sheets[1];           //calısma alanı çalısma sayfası 1 rakamı kacıncı sayfada calısacaksak
            int             sutun = 1;                                          //excele yazdıracagımız satır
            int             satır = 1;                                          //excele yazdıracagımız sutun

            for (int i = 0; i < dataGridView1.Columns.Count; i++)               //5 alan varsa 5 dönecek
            {
                excel.Range hücre = (excel.Range)sayfa.Cells[satır, sutun + i]; //alan hangi alan hücre biri sıfırdan digeri biroldugu için +2
                hücre.Value2 = dataGridView1.Columns[i].HeaderText;             //alanın o degerine
            }
            satır++;
            for (int z = 0; z < dataGridView1.Rows.Count; z++)
            {
                for (int i = 0; i < dataGridView1.Columns.Count; i++)
                {
                    try
                    {
                        excel.Range hücre = (excel.Range)sayfa.Cells[satır + z, sutun + i];
                        hücre.Value2 = dataGridView1[i, z].Value;
                    }
                    catch (Exception AAA)
                    {
                        MessageBox.Show(AAA.ToString());
                    }
                }
            }
        }
Example #5
0
 public static void Test(AAA a)
 {
     if (a == null)
     {
         a = new AAA();
     }
 }
Example #6
0
    void Awake()
    {
        aaa          = new AAA();
        aaa.a        = 100;
        aaa.b        = 123;
        aaa.c        = 99.5f;
        aaa.s        = "ssss";
        aaa.ccc      = new CCC();
        aaa.ccc.name = "ccc";
        aaa.ccc.list = new List <ABC> ();
        ABC abc = new ABC();

        abc.i = 999;
        aaa.ccc.list.Add(abc);
        aaa.list = new List <CCC> ();
        aaa.list.Add(aaa.ccc);
        var          serializer = MsgPack.Serialization.MessagePackSerializer.Get <AAA> ();
        MemoryStream ms         = new MemoryStream();

        serializer.Pack(ms, aaa);
        Debug.Log(ms.Length);
        ms.Position = 0;

        var a5 = serializer.Unpack(ms);
        int ii = 8;

        for (int i = 0; i < a5.ccc.list.Count; ++i)
        {
            Debug.Log(a5.ccc.list [i]);
        }
    }
Example #7
0
 public void R9()
 {
     Time = 120;//下一波攻擊時間
     AAA.firedM2();
     MakeMonster("B1", new MONSTER6_A(new Vector2(200, -200)), 2 + GamePage.HERO_S);
     MakeMonster("B1", new MONSTER6_A(new Vector2(200, -400)), 2 + GamePage.HERO_S);
 }
 public Person(int num, double width)
 {
     Items = new AAA();
     for (int i = 0; i < num; i++)
     {
         Items.Add(new aaa(num + i, width / (num + 1)));
     }
 }
Example #9
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            AAA se = new AAA();

            se.algo1();
            //MessageBox.Show("вы разгрузили груз");
            terra4.Visibility = Visibility.Hidden;
            terra3.Visibility = Visibility.Visible;
        }
Example #10
0
        static void Main(string[] args)
        {
            AAA Obj1 = new AAA();
            BBB Obj2 = new BBB();
            int R1   = Obj1.F(2, 5);
            int R2   = Obj2.F(2, 5);

            Console.WriteLine(R2);
        }
Example #11
0
        static void Main(string[] args)
        {
            AAA   Obj  = new AAA(5, 6);
            BBB   Obj2 = new BBB(1, 2, 4, 5);
            int   R1   = Obj2.F(2, 5);
            float R2   = Obj2.F(2, 5.0f);

            Console.Write(R2);
        }
Example #12
0
 void OnGUI()
 {
     if (GUI.Button(new Rect(10, 100, 300, 150), "try"))
     {
         AAA    aaa    = new AAA("aaa");
         AAA    bbb    = new AAA("bbb");
         object obj111 = aa(20, aaa, bbb);
         Debug.Log((obj111 as AAA).name);
     }
 }
Example #13
0
        public void R15()
        {
            GamePage.Thunder = true;
            GamePage.R_LV.allMLoss(1);


            Time = 200;//下一波攻擊時間
            MakeMonster("B1", new MONSTER4_A(new Vector2(200, 0)), 3);
            AAA.callMonster("MONSTER6_A", 5);
        }
Example #14
0
        public void R9()
        {
            Time = 350;//下一波攻擊時間
            AAA.firedM2();
            MakeMonster("C1", new MONSTER7_A(new Vector2(0, 0)), 15);
            MakeMonster("C1", new MONSTER7_B(new Vector2(0, 0)), 15);
            MakeMonster("C1", new MONSTER7_C(new Vector2(0, 0)), 15);

            MakeMonster("A1", new MONSTER2_A(new Vector2(50, 0)), 5 + GamePage.HERO_S);
            MakeMonster("A1", new MONSTER21_A(new Vector2(440, 0)), 5 + GamePage.HERO_S);
        }
Example #15
0
    public static void Main()
    {
        Console.WriteLine("Hello World");
        AAA a = ReturnNull();

        Test(a);
        //Console.Write(a.B);

        var myList = new List <long>();

        Console.WriteLine(myList.Count);
    }
Example #16
0
    // Use this for initialization
    void Start()
    {
        System.Object o = null;
        {
            AAA a = new AAA("a1");
            o = a;
        }
        AAA b = new AAA("a2");

        o = b;
        Debug.Log("o.RefCount = " + o.GetType());
    }
Example #17
0
        public void R7()
        {
            Time = 30;//下一波攻擊時間
            AAA.callMonster("BOSS5_G", 1 + GamePage.HERO_S);
            MakeMonster("C1", new MONSTER7_B(new Vector2(0, 0)), 10);



            //右邊
            for (int i = 0; i < 15; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(450, -40 * i));
                MMM.Yn = GamePage.randObj.Next(0, 150);

                MMM.N2     = GamePage.randObj.Next(80, 320);
                MMM.ADD_X2 = (float)(GamePage.randObj.Next(-150, 0) * 0.01);
                MMM.ADD_Y2 = 2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }



            //左邊
            for (int i = 0; i < 15; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(50, -40 * i));
                MMM.Yn = GamePage.randObj.Next(0, 150);

                MMM.N2     = GamePage.randObj.Next(80, 320);
                MMM.ADD_X2 = (float)(GamePage.randObj.Next(0, 150) * 0.01);
                MMM.ADD_Y2 = 2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
    private void Test5()
    {
        Dictionary <int, AAA> mDic = new Dictionary <int, AAA> ();

        mDic [1] = new AAA("1213e23");
        mDic [2] = new AAA("23232r23r");

        var iter = mDic.GetEnumerator();

        while (iter.MoveNext())
        {
            iter.Current.Value.aaa = "werwrwerweerwer";

            DebugSystem.Log(iter.Current.Value.aaa);
        }
    }
Example #19
0
        public void R6()
        {
            Time = 200;//下一波攻擊時間
            AAA.firedM2();

            MakeMonster("A1", new MONSTER41_A(new Vector2(320, 700)), 2);



            for (int i = 0; i < 12; i++)
            {
                MONSTER11_B MMM = new MONSTER11_B(new Vector2(380, -60 * i));
                MMM.Yn = 400;

                MMM.N2     = 150;
                MMM.ADD_X2 = -1.5f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;

                BOX.Add(MMM);
            }



            for (int i = 0; i < 12; i++)
            {
                MONSTER11_B MMM = new MONSTER11_B(new Vector2(100, -60 * i));
                MMM.Yn = 400;

                MMM.N2     = 150;
                MMM.ADD_X2 = 1.5f;
                MMM.ADD_Y2 = -2f;


                MMM.N3     = 500;
                MMM.ADD_X3 = 0f;
                MMM.ADD_Y3 = 2f;



                BOX.Add(MMM);
            }
        }
Example #20
0
        public void Can_append_new_default_implementation_And_ignore_the_duplicate_implementation()
        {
            var container = new Container();

            var aa = new DependencyA();

            container.RegisterInstance(aa);
            container.RegisterInstance <DependencyA>(new AAA(), IfAlreadyRegistered.AppendNewImplementation);

            Assert.AreEqual(2, container.ResolveMany <DependencyA>().Count());

            var newaaa = new AAA();

            container.RegisterInstance <DependencyA>(newaaa, IfAlreadyRegistered.AppendNewImplementation);

            container.RegisterInstance <DependencyA>(new AAAA(), IfAlreadyRegistered.AppendNewImplementation);
            Assert.AreEqual(3, container.ResolveMany <DependencyA>().Count());
        }
Example #21
0
        public void ErrorHandlingMetadata()
        {
            List <Exception> errors = new List <Exception>();

            AAA a2 = JsonConvert.DeserializeObject <AAA>(@"{""MyTest"":{""$type"":""<Namespace>.JsonTest+MyTest2, <Assembly>""}}", new JsonSerializerSettings
            {
                TypeNameHandling = TypeNameHandling.Auto,
                Error            = (object sender, Json.Serialization.ErrorEventArgs e) =>
                {
                    errors.Add(e.ErrorContext.Error);
                    e.ErrorContext.Handled = true;
                }
            });

            Assert.IsNotNull(a2);
            Assert.AreEqual(1, errors.Count);
            Assert.AreEqual("Error resolving type specified in JSON '<Namespace>.JsonTest+MyTest2, <Assembly>'. Path 'MyTest.$type', line 1, position 61.", errors[0].Message);
        }
Example #22
0
        public JsonResult table(string aaa, string bbb, string page, string limit)
        {
            List <bbb> b = new List <bbb>();

            for (int i = 0; i < 20; i++)
            {
                bbb bb = new bbb
                {
                    ID           = i.ToString(),
                    productName  = page + "ye" + i.ToString(),
                    productState = "",
                    effectTime   = i.ToString(),
                    invalidTime  = i.ToString(),
                    productCost  = i.ToString(),
                    poperation   = i.ToString()
                };
                b.Add(bb);
            }

            AAA a = new AAA
            {
                code  = "0",
                msg   = "",
                count = "200",
                data  = b
            };

            return(Json(a, JsonRequestBehavior.AllowGet));


            //DividPage page = new DividPage { CurrentPageShowCounts = 10000 };

            //T_Customer_Func func = new T_Customer_Func();
            //List<T_CustomerInfo> modelList = new List<T_CustomerInfo>();
            //T_CustomerInfo model = new T_CustomerInfo();
            //string strError = "";
            //func.GetModelListByPage(ref modelList, Common.Commom.currentUser, model, ref page, ref strError);
            //return Json(new { state = false, obj = modelList }, JsonRequestBehavior.AllowGet);
        }
 public MappingProfile()
 {
     CreateMap <AppointmentAddition, AppointmentAdditionDTO>().ReverseMap();
     CreateMap <AppointmentCategory, AppointmentCategoryDTO>().ReverseMap();
     CreateMap <Attachment, AttachmentDTO>().ReverseMap();
     CreateMap <Expense, ExpenseDTO>().ReverseMap();
     CreateMap <MedicalHistory, MedicalHistoryDTO>().ReverseMap();
     CreateMap <User, UserDTO>().ReverseMap();
     CreateMap <AppointmentTooth, AppointmentToothDTO>().ReverseMap();
     CreateMap <Clinic, ClinicDTO>().ReverseMap();
     CreateMap <Patient, PatientDTO>()
     .ForMember(dto => dto.MedicalHistoryList, PMH => PMH.MapFrom(MH => MH.PatientMedicalHistoryList.Select(cs => cs.MedicalHistory)))
     .ReverseMap();
     CreateMap <Appointment, AppointmentDTO>()
     .ForMember(dto => dto.Patient, pat => pat.MapFrom(model => model.Patient))
     .ForMember(dto => dto.Clinic, clinic => clinic.MapFrom(c => c.Clinic))
     .ForMember(dto => dto.Category, cat => cat.MapFrom(c => c.Category))
     .ForMember(dto => dto.User, doc => doc.MapFrom(c => c.User))
     .ForMember(dto => dto.AppointmentAdditionList, AAA => AAA.MapFrom(AA => AA.AppointmentAppointmentAdditionList.Select(aa => aa.AppointmentAddition)))
     .ForMember(dto => dto.AttachmentList, AAA => AAA.MapFrom(AA => AA.AttachmentList))
     .ForMember(dto => dto.ToothList, AAA => AAA.MapFrom(AA => AA.AppointmentToothList))
     .ReverseMap();
 }
Example #24
0
        public void R12()
        {
            Time = 300;//下一波攻擊時間

            AAA.callMonster("MONSTER71", 25);
            for (int i = 0; i < 25; i++)
            {
                MONSTER11_A MMM = new MONSTER11_A(new Vector2(240, -40 * i));
                MMM.Yn = 100;

                if (i % 2 == 0)
                {
                    MMM.N2     = 150;
                    MMM.ADD_X2 = -1f;
                    MMM.ADD_Y2 = 2f;


                    MMM.N3     = 500;
                    MMM.ADD_X3 = 1f;
                    MMM.ADD_Y3 = 2f;
                }
                else
                {
                    MMM.N2     = 150;
                    MMM.ADD_X2 = 1f;
                    MMM.ADD_Y2 = 2f;


                    MMM.N3     = 500;
                    MMM.ADD_X3 = -1f;
                    MMM.ADD_Y3 = 2f;
                }

                BOX.Add(MMM);
            }
        }
Example #25
0
 void MethodAAA(AAA aaa, BBB bbb)
 {
     aaa.a = 100;
     bbb.a = 200;
 }
Example #26
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            AAA se = new AAA();

            se.result();
        }
        //}
        /// <summary>
        //        /*=============================================================================================
        //        '程式說明:扣玩家Gash點數
        //        '傳入參數:	MainAccountID : GASH_ID
        //        '		Memo:內容("橘子柑仔店競標")
        //        '		ServiceCode : 服務代碼(如:"999995")
        //        '		ServiceRegion : 服務區域代碼 (如:"T0")
        //        '		Time : 消費時間
        //        '		Point : 此次消費點數
        //        '		Memo : 附註
        //        '		IPAddress : IP位址
        //        '傳回結果:	"0":失敗
        //        '		"1":成功
        //        =============================================================================================*/
        public static string Deduct_GASHPoint_ServiceAccount(string tmpGash, string tempService, string tmpRegion, string str_Region, int ExpectPont, string tmpMemo, string tmpIP)
        {
            try
            {
                AAA Gash_WS = new AAA();
                switch (str_Region.ToUpper())
                {
                    case "TW":
                        Gash_WS.Url = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["GASHv30FWS_AAA"] ?? "");
                        break;
                    case "HK":
                        Gash_WS.Url = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["GASHv30FWS_AAA_HK"] ?? "");
                        break;
                    default:
                        Gash_WS.Url = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["GASHv30FWS_AAA"] ?? "");
                        break;
                }

                if (tmpGash.Length <= 0 || ExpectPont <= 0)
                { return "0;點數錯誤(111)"; }
                else
                {
                    string nowDate = DateTime.Now.ToString("yyyy/MM/dd") + " " + DateTime.Now.Hour.ToString() + DateTime.Now.ToString(":mm:ss");    //避免上下午混用,轉成24H制
                    string myresult = Gash_WS.ServiceAccount_AccountingFreePoint(tempService, tmpRegion, tmpGash, nowDate, ExpectPont, tmpMemo, tmpIP);
                    if (myresult.Length > 0)
                    {
                        if (myresult.Substring(0, 1) == "1")
                        { return "1"; }
                        else
                        { return myresult; }
                    }
                    else
                    {
                        return "0;扣點回傳錯誤(沒有回傳值)(111)";
                    }
                }

            }
            catch
            {
                return "0;扣點發生不明錯誤(111)";
            }
        }
Example #28
0
        //[TestMethod]
        public void TestReadCsvLeve3()
        {
            FileInfo fi = new FileInfo(@"d:\wukan\Desktop\DepthDataShow\20150120.txt");
            //FileInfo fo = new FileInfo(@"F:\BaiduYunDownload\DepthDataShow\20150120.pd0");

            PbTickSerializer pts = new PbTickSerializer();

            CCC ccc = new CCC();
            CCC last_ccc = new CCC();

            AAA last = new AAA();
            last.buy = false;

            string last_symbol = "XXX";

            List<AAA> list = new List<AAA>();

            //using (Stream stream = File.Open(@"F:\BaiduYunDownload\DepthDataShow\20150120.pd0", FileMode.Create))
            {
                using (StreamReader file = new StreamReader(fi.OpenRead()))
                {
                    int i = 0;
                    string str;
                    do
                    {
                        ++i;
                        str = file.ReadLine();
                        if (str == null)
                            break;

                        string[] arr = str.Split(',');

                        AAA a = new AAA();
                        a.symbol = arr[1];
                        a.buy = arr[2] == "0";
                        a.price = double.Parse(arr[3]);
                        a.size = int.Parse(arr[4]);


                        if (last.buy == false && a.buy == true)
                        {
                            // 快照的切换点,把上次的存储都取出来,进行保存
                            // sell里先存的数字大的,后存的数字小的,最后的是卖一
                            // buy里也是先存数字大的,后存数字小的,最前的买一
                            // 
                            foreach (var kv in ccc.dict)
                            {
                                kv.Value.MakeTick();

                                ccc.GetSerializer(kv.Key).Write(kv.Value.tick,
                                    new Stream[] { ccc.GetStream(kv.Key) });
                            }

                            ccc.dict.Clear();
                        }

                        BBB bbb = ccc.Get(a.symbol);
                        bbb.symbol = a.symbol;
                        bbb.time = arr[0];

                        if (bbb.symbol == "cu1502")
                        {
                            int nTest = 1;
                        }

                        if (a.buy)
                        {
                            bbb.AddBid(a);
                        }
                        else
                        {
                            bbb.AddAsk(a);
                        }


                        last = a;
                        last_symbol = a.symbol;

                        //if (i < 4000)
                        //    Console.WriteLine(str);
                        //if (i > 4000)
                        //    break;
                    } while (str != null);
                    file.Close();
                }
            }
        }
Example #29
0
        public void R11()
        {
            Time = 200;//下一波攻擊時間

            AAA.callMonster("MONSTER71", 25);
        }
Example #30
0
 public void AddBid(AAA b)
 {
     // 由大到小
     if (Bids.Count > 1)
     {
         double diff = Bids[Bids.Count - 1].price - b.price;
         if (diff > 0)
             TickSize = Codec.gcd(TickSize, diff);
     }
     else
     {
         TickSize = Codec.gcd(TickSize, b.price);
     }
     Bids.Add(b);
 }
Example #31
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            AAA se = new AAA();

            se.RED(Convert.ToInt32(rer.Text));
        }
Example #32
0
 public void AddAsk(AAA a)
 {
     // 由小到大
     if (Asks.Count > 1)
     {
         double diff = a.price - Asks[Asks.Count - 1].price;
         if (diff > 0)
             TickSize = Codec.gcd(TickSize, diff);
     }
     else
     {
         TickSize = Codec.gcd(TickSize, a.price);
     }
     Asks.Add(a);
 }
        /// <summary>
        /// GASH主帳號自由點數扣點;
        /// 若此服務有專用點數會先扣專用專用點數;
        /// 此功能只適用於限開單一服務帳號的服務/遊戲
        /// </summary>
        /// <param name="GashAccount"></param>
        /// <param name="GashRegion"></param>
        /// <returns>"1":成功; 	"0":失敗</returns>
        public string Deduct_GASHPoint(string GashAccount, string ServiceCode, string ServiceRegion, string GashRegion, int ExpectPont, string Memo, string IP)
        {
            string Result = "0";
            string wsResult = string.Empty;
            string[] aryResult;
            string nowDate = DateTime.Now.ToString("yyyy/MM/dd") + " " + DateTime.Now.Hour.ToString() + DateTime.Now.ToString(":mm:ss");    //避免上下午混用,轉成24H制

            using (AAA ws = new AAA())
            {
                ws.Url = GetGashWSUrl("AAA", GashRegion.ToUpper());
                try
                {
                    //WS return: intResult;Outstring
                    //intResult: (1  Success, 0  Failed, -1  Error)
                    wsResult = ws.MainAccount_AccountingFreePoint(GashAccount, ServiceCode, ServiceRegion, nowDate, ExpectPont, Memo, IP);
                    aryResult = wsResult.Split(";".ToCharArray());
                    Result = (aryResult[0] == "1") ? "1" : "0";
                    OutputResult = aryResult[0];
                }
                catch (Exception ex)
                {
                    Result = "0";
                    WSException = ex;
                    aryResult = new string[] { "" };
                }
            }

            OutputMsg = (aryResult != null && aryResult.Length > 1) ? aryResult[1] : wsResult;

            return Result;
        }
Example #34
0
 public void R10()
 {
     Time = 10;//下一波攻擊時間
     AAA.firedM2();
 }
Example #35
0
 void MethodBBB(AAA aaa, BBB bbb)
 {
     //aaa.a = 100; Доступа нет
     bbb.a = 200;
 }