Пример #1
0
        public void TestMethod24()
        {
            // testing bg

            RegisterFile <Vector4> vRF = new RegisterFile <Vector4>(32);
            RegisterFile <Scalar>  sRF = new RegisterFile <Scalar>(33);
            Memory           m         = new Memory(5000);
            Memory           m_ic      = new Memory(5000);
            IntersectionCore ic        = new IntersectionCore(m_ic);



            cmp_f c = new cmp_f(1, 2);
            bg    b = new bg(5);

            sRF[1] = (float)1.5;
            sRF[2] = (float)1.5;
            c.Process(vRF, sRF, m, ic);

            b.Process(vRF, sRF, m, ic);

            Assert.AreEqual <int>(0, sRF[31].i);

            sRF[1] = (float)2;
            sRF[2] = (float)1;
            c.Process(vRF, sRF, m, ic);

            b.Process(vRF, sRF, m, ic);

            Assert.AreEqual <int>(5, sRF[31].i);
        }
Пример #2
0
    // Use this for initialization

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        if (true)
        {
            audio.mute = true;
        }
    }
Пример #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.Text                       = System.Configuration.ConfigurationManager.AppSettings["programName"];
            this.lb_appname.Text            = System.Configuration.ConfigurationManager.AppSettings["programName"];
            this.toolStripStatusLabel1.Text = "Version:" + Assembly.GetExecutingAssembly().GetName().Version.ToString();

            this.treeView1.ExpandAll();

            this.lb_user.Text = "用户:" + Convert.ToString(Program.uClass.name_str);

            bg b1 = new bg();

            b1.MdiParent = this;
            b1.Show();
            b1.Dock = DockStyle.Fill;

            //如果是用的WCF方式加滚动条,可以把toolStripProgressBar1传递给子窗体,用来显示滚动条.
        }
Пример #4
0
        public void TestMethod33()
        {
            // ToString test
            and and = new and(1, 2, 3);

            Assert.AreEqual("and r1 r2 r3", and.ToString());
            bne bne = new bne(1);

            Assert.AreEqual("bne 1", bne.ToString());
            bg bg = new bg(1);

            Assert.AreEqual("bg 1", bg.ToString());
            bl bl = new bl(1);

            Assert.AreEqual("bl 1", bl.ToString());
            bge_rt bge_rt = new bge_rt(1);

            Assert.AreEqual("bge_rt 1", bge_rt.ToString());
            ble_rt ble_rt = new ble_rt(1);

            Assert.AreEqual("ble_rt 1", ble_rt.ToString());
            cmp_i cmpi = new cmp_i(1, 2);

            Assert.AreEqual("cmp_i r1 r2", cmpi.ToString());
            cmp_f cmpf = new cmp_f(1, 2);

            Assert.AreEqual("cmp_f r1 r2", cmpf.ToString());
            cmp_v cmpv = new cmp_v(1, 2);

            Assert.AreEqual("cmp_v r1 r2", cmpv.ToString());
            ff_add ff_add = new ff_add(1, 2, 3);

            Assert.AreEqual("ff_add r1 r2 r3", ff_add.ToString());
            ff_sub ff_sub = new ff_sub(1, 2, 3);

            Assert.AreEqual("ff_sub r1 r2 r3", ff_sub.ToString());
            ff_mul ff_mul = new ff_mul(1, 2, 3);

            Assert.AreEqual("ff_mul r1 r2 r3", ff_mul.ToString());
            ff_div ff_div = new ff_div(1, 2, 3);

            Assert.AreEqual("ff_div r1 r2 r3", ff_div.ToString());
            fin fin = new fin();

            Assert.AreEqual("fin", fin.ToString());
            ftoi ftoi = new ftoi(1, 2);

            Assert.AreEqual("ftoi r1 r2", ftoi.ToString());
            ii_add ii_add = new ii_add(1, 2, 3);

            Assert.AreEqual("ii_add r1 r2 r3", ii_add.ToString());
            ii_addi ii_addi = new ii_addi(1, 2, 3);

            Assert.AreEqual("ii_addi r1 r2 3", ii_addi.ToString());
            ii_sub ii_sub = new ii_sub(1, 2, 3);

            Assert.AreEqual("ii_sub r1 r2 r3", ii_sub.ToString());
            ii_subi ii_subi = new ii_subi(1, 2, 3);

            Assert.AreEqual("ii_subi r1 r2 3", ii_subi.ToString());
            ii_mul ii_mul = new ii_mul(1, 2, 3);

            Assert.AreEqual("ii_mul r1 r2 r3", ii_mul.ToString());
            ii_muli ii_muli = new ii_muli(1, 2, 3);

            Assert.AreEqual("ii_muli r1 r2 3", ii_muli.ToString());
            ii_div ii_div = new ii_div(1, 2, 3);

            Assert.AreEqual("ii_div r1 r2 r3", ii_div.ToString());
            ii_divi ii_divi = new ii_divi(1, 2, 3);

            Assert.AreEqual("ii_divi r1 r2 3", ii_divi.ToString());
            itof itof = new itof(1, 2);

            Assert.AreEqual("itof r1 r2", itof.ToString());
            real_jmp real_jmp = new real_jmp(1);

            Assert.AreEqual("real_jmp 1", real_jmp.ToString());
            jmp_link jmp_link = new jmp_link(1);

            Assert.AreEqual("jmp_link 1", jmp_link.ToString());
            not not = new not(1, 2);

            Assert.AreEqual("not r1 r2", not.ToString());
            or or = new or(1, 2, 3);

            Assert.AreEqual("or r1 r2 r3", or.ToString());
            ret ret = new ret();

            Assert.AreEqual("ret", ret.ToString());
            s_get_from_v sgfv = new s_get_from_v(1, 2, 3);

            Assert.AreEqual("s_get_from_v r1 r2 3", sgfv.ToString());
            s_load_4byte sl4b = new s_load_4byte(1, 2, 3);

            Assert.AreEqual("s_load_4byte r1 r2 3", sl4b.ToString());
            s_store_4byte ss4b = new s_store_4byte(1, 2, 3);

            Assert.AreEqual("s_store_4byte r1 r2 3", ss4b.ToString());
            s_write_high swh = new s_write_high(1, 5);

            Assert.AreEqual("s_write_high r1 5", swh.ToString());
            s_write_low swl = new s_write_low(1, 5);

            Assert.AreEqual("s_write_low r1 5", swl.ToString());
            s_push s_push = new s_push(1);

            Assert.AreEqual("s_push r1", s_push.ToString());
            s_pop s_pop = new s_pop(1);

            Assert.AreEqual("s_pop r1", s_pop.ToString());
            v_push v_push = new v_push(1);

            Assert.AreEqual("v_push r1", v_push.ToString());
            v_pop v_pop = new v_pop(1);

            Assert.AreEqual("v_pop r1", v_pop.ToString());
            v_get_from_s vgfs = new v_get_from_s(1, 2, 3);

            Assert.AreEqual("v_get_from_s r1 r2 3", vgfs.ToString());
            v_load_16byte vl16 = new v_load_16byte(1, 2, 3);

            Assert.AreEqual("v_load_16byte r1 r2 3", vl16.ToString());
            v_magn v_magn = new v_magn(1, 2);

            Assert.AreEqual("v_magn r1 r2", v_magn.ToString());
            v_store_16byte vs16 = new v_store_16byte(1, 2, 3);

            Assert.AreEqual("v_store_16byte r1 r2 3", vs16.ToString());
            vf_add vf_add = new vf_add(1, 2, 3);

            Assert.AreEqual("vf_add r1 r2 r3", vf_add.ToString());
            vf_sub vf_sub = new vf_sub(1, 2, 3);

            Assert.AreEqual("vf_sub r1 r2 r3", vf_sub.ToString());
            vf_mul vf_mul = new vf_mul(1, 2, 3);

            Assert.AreEqual("vf_mul r1 r2 r3", vf_mul.ToString());
            vf_div vf_div = new vf_div(1, 2, 3);

            Assert.AreEqual("vf_div r1 r2 r3", vf_div.ToString());
            vi_add vi_add = new vi_add(1, 2, 3);

            Assert.AreEqual("vi_add r1 r2 r3", vi_add.ToString());
            vi_sub vi_sub = new vi_sub(1, 2, 3);

            Assert.AreEqual("vi_sub r1 r2 r3", vi_sub.ToString());
            vi_mul vi_mul = new vi_mul(1, 2, 3);

            Assert.AreEqual("vi_mul r1 r2 r3", vi_mul.ToString());
            vi_div vi_div = new vi_div(1, 2, 3);

            Assert.AreEqual("vi_div r1 r2 r3", vi_div.ToString());
            vv_add vv_add = new vv_add(1, 2, 3);

            Assert.AreEqual("vv_add r1 r2 r3", vv_add.ToString());
            vv_sub vv_sub = new vv_sub(1, 2, 3);

            Assert.AreEqual("vv_sub r1 r2 r3", vv_sub.ToString());
            vv_mul_ele vv_mul_ele = new vv_mul_ele(1, 2, 3);

            Assert.AreEqual("vv_mul_ele r1 r2 r3", vv_mul_ele.ToString());
            vv_mul_dot vv_mul_dot = new vv_mul_dot(1, 2, 3);

            Assert.AreEqual("vv_mul_dot r1 r2 r3", vv_mul_dot.ToString());
            vv_div vv_div = new vv_div(1, 2, 3);

            Assert.AreEqual("vv_div r1 r2 r3", vv_div.ToString());
            xor xor = new xor(1, 2, 3);

            Assert.AreEqual("xor r1 r2 r3", xor.ToString());
        }
Пример #5
0
        void changegb()
        {
            if (canchange == true)
            {
                if ((Players[0].mLevel % 1 == 0) && (Players[0].mLevel != 0))
                {
                    canchange = false;
                    cbg++;
                    if (cbg == bg.six)
                        cbg = bg.one;
                    switch (cbg)
                    {
                        case bg.one:
                            mBackground2 = one;
                            mSound.Play(Sound.Music.Background);
                            ForegroundBatch.Draw(mBackground2, new Rectangle(0, 0, 1280, 720), Color.White);
                            break;
                        case bg.two:
                            mBackground2 = two;
                            mSound.Play(Sound.Music.Background1);
                            ForegroundBatch.Draw(mBackground2, new Rectangle(0, 0, 1280, 720), Color.White);
                            break;
                        case bg.three:
                            mBackground2 = three;
                            mSound.Play(Sound.Music.Background2);
                            ForegroundBatch.Draw(mBackground2, new Rectangle(0, 0, 1280, 720), Color.White);
                            break;
                        case bg.four:
                            mBackground2 = four;
                            mSound.Play(Sound.Music.Background3);
                            ForegroundBatch.Draw(mBackground2, new Rectangle(0, 0, 1280, 720), Color.White);
                            break;
                        case bg.five:
                            mSound.Play(Sound.Music.Background1);
                            mBackground2 = five;
                            ForegroundBatch.Draw(mBackground2, new Rectangle(0, 0, 1280, 720), Color.White);
                            break;
                    }
                }

            }
            ForegroundBatch.Draw(mBackground2, new Rectangle(0, 0, 1280, 720), Color.White);
            if (Players[0].mLevel % 1 != 0)
            {
                canchange = true;
            }
        }
Пример #6
0
    void Start()
    {
        GetComponent <camping>().Load();
        GetComponent <player>().Load();
        yourCam = GetComponent <camping>();
        //
        IdLevel = PublicClass.level;
        box     = GetComponent <BoxCollider2D>();
        foreach (var i in Background)
        {
            foreach (var j in i.Ids)
            {
                if (j == IdLevel)
                {
                    InBackground = i;
                    break;
                }
            }
        }
        Next = InBackground.Content.GetComponentInChildren <BoxCollider2D>().size.x *InBackground.Content.GetComponentInChildren <BoxCollider2D>().gameObject.transform.localScale.x;
        Vector3 ins = new Vector3(-3, transform.position.y, 20);

        Instantiate(InBackground.Content, ins, Quaternion.identity, transform);
        foreach (var item in yourCam.Player.CampaingDbList)
        {
            if (item.IdCampaing == IdLevel)
            {
                MyCamp  = item;
                TimeEnd = MyCamp.TimeEnd;
                break;
            }
        }
        Text t = GameObject.Find("txtLevel").GetComponent <Text>();

        t.text     = MyCamp.NameCampaing;
        myPhase    = MyCamp.PhaseList;
        txtTimeEnd = GameObject.Find("txtTimeEnd").GetComponent <Text>();
        TimeSpan time = TimeSpan.FromSeconds(TimeEnd);

        txtTimeEnd.text = "TIME: " + time.Minutes.ToString("00") + ":" + time.Seconds.ToString("00");
        var max = myPhase[myPhase.Length - 1].EndLockMap / 1980 / 2;

        box.size   = new Vector2(myPhase[myPhase.Length - 1].EndLockMap * PublicClass.dpp + 20, box.size.y);
        box.offset = new Vector2(box.size.x / 2, box.offset.y);
        for (int i = 1; i <= max + 1; i++)
        {
            Vector3 insx = new Vector3(i * Next - 3, transform.position.y, 20);
            Instantiate(InBackground.Content, insx, Quaternion.identity, transform);
        }

        foreach (var item in MainCharacter)
        {
            if (item.GetComponent <mainController>().MyID == GetComponent <player>().Player.MC)
            {
                var e = Instantiate(item, new Vector3(MyCamp.StartMC * PublicClass.dpp, 0, 0), Quaternion.identity);
                e.GetComponent <mainController>().myAnim.speed = 0;
                break;
            }
        }
        Invoke("OnStart", 2);
    }