public override string ToString()
        {
            s = (CUT)base.Tag;

            Binding myBinding = new Binding("result");
            myBinding.Mode = BindingMode.TwoWay;
            myBinding.Source = s;
            txtres.SetBinding(TextBox.TextProperty, myBinding);

            Binding myBinding2 = new Binding("variable");
            myBinding2.Mode = BindingMode.TwoWay;
            myBinding2.Source = s;
            txtvar.SetBinding(TextBox.TextProperty, myBinding2);

            Binding myBinding3 = new Binding("delimiter");
            myBinding3.Mode = BindingMode.TwoWay;
            myBinding3.Source = s;
            txtdel.SetBinding(TextBox.TextProperty, myBinding3);

            Binding myBinding4 = new Binding("fieldspec");
            myBinding4.Mode = BindingMode.TwoWay;
            myBinding4.Source = s;
            txtspec.SetBinding(TextBox.TextProperty, myBinding4);


            Binding descbinding = new Binding("Description");
            descbinding.Mode = BindingMode.TwoWay;
            descbinding.Source = s;
            txtdesc.SetBinding(TextBox.TextProperty, descbinding);


            return base.ToString();
        }
        public void ArgumentBuilder_WithMultipleProjects_ThrowsException()
        {
            var instance = new CUT();

            instance.SetProject("");
            Assert.Throws <InvalidOperationException>(() => instance.SetProject(""));
        }
Ejemplo n.º 3
0
 public void Validation_should_succeed_with_a_valid_object()
 {
     Assert.IsTrue(CUT.Validate(new TestViewModel
     {
         NotNull = "blah",
         NotZero = 1
     }).IsValid);
 }
        public void ArgumentBuilder_WithMultipleMatchers_Works()
        {
            var instance = new CUT();

            instance.AddMatcher("");
            instance.AddMatcher("");
            // assertion is not throwing an exception
        }
        public void ArgumentBuilder_WithMatcher_IsInvalid()
        {
            var instance = new CUT();

            instance.AddMatcher("");

            Assert.IsFalse(instance.IsValid());

            instance.Inverted();
            Assert.IsFalse(instance.IsValid());
            Assert.Throws <InvalidOperationException>(() => instance.Build());
        }
        public void GetAllPlanTypes_ShouldReturnAllValidValues_UnderAllConditions()
        {
            // Arrange & Act
            PlanType[] output = CUT.GetAllPlanTypes().ToArray();

            // Assert
            output.ShouldNotBeNull();
            output.ShouldNotBeEmpty();
            output.ShouldContain(PlanType.Fixed);
            output.ShouldContain(PlanType.Variable);
            output.ShouldContain(PlanType.Indexed);
        }
        public void GetAllCommodities_ShouldReturnAllValidValues_UnderAllConditions()
        {
            // Arrange & Act
            Commodity[] output = CUT.GetAllCommodities().ToArray();

            // Assert
            output.ShouldNotBeNull();
            output.ShouldNotBeEmpty();
            output.ShouldContain(Commodity.Electric);
            output.ShouldContain(Commodity.Gas);
            output.ShouldContain(Commodity.Solar);
        }
        public void GetAllAccountClasses_ShouldReturnAllValidValues_UnderAllConditions()
        {
            // Arrange & Act
            AccountClass[] output = CUT.GetAllAccountClasses().ToArray();

            // Assert
            output.ShouldNotBeNull();
            output.ShouldNotBeEmpty();
            output.ShouldContain(AccountClass.Residential);
            output.ShouldContain(AccountClass.SmallCommercial);
            output.ShouldContain(AccountClass.LargeCommercial);
        }
        public void ArgumentBuilder_WithOwnerAndProjectAndMatcher_IsValid()
        {
            var instance = new CUT();

            instance.SetOwner("");
            instance.SetProject("");
            instance.AddMatcher("");

            Assert.IsTrue(instance.IsValid());

            instance.Inverted();
            Assert.IsTrue(instance.IsValid());
        }
        public void ArgumentBuilder_WithOwnerAndProject_IsInvalid()
        {
            var instance = new CUT();

            instance.SetOwner("");
            instance.SetProject("");

            Assert.IsFalse(instance.IsValid());

            instance.Inverted();
            Assert.IsFalse(instance.IsValid());
            Assert.Throws <InvalidOperationException>(() => instance.Build());
        }
 public void ArgumentBuilder_WithMultipleInverts_StaysInverted()
 {
     int[] repetitions = { 2, 3, 12, 152, 61, 6, 125, 62 };
     foreach (var reps in repetitions)
     {
         var instance = new CUT();
         for (int i = 0; i < reps; i++)
         {
             instance.Inverted();
         }
         Assert.IsTrue(instance.InvertedMatching);
     }
 }
Ejemplo n.º 12
0
        public void GetAllRateTypes_ShouldReturnAllValidValues_UnderAllConditions()
        {
            // Arrange & Act
            RateType[] output = CUT.GetAllRateTypes().ToArray();

            // Assert
            output.ShouldNotBeNull();
            output.ShouldNotBeEmpty();
            output.ShouldContain(RateType.Enrollment);
            output.ShouldContain(RateType.Switch);
            output.ShouldContain(RateType.Renewal);
            output.ShouldContain(RateType.Intro);
            output.ShouldContain(RateType.Winback);
        }
Ejemplo n.º 13
0
        public void GetAllUnitOfMeasures_ShouldReturnAllValidValues_UnderAllConditions()
        {
            // Arrange & Act
            UnitOfMeasure[] output = CUT.GetAllUnitOfMeasures().ToArray();

            // Assert
            output.ShouldNotBeNull();
            output.ShouldNotBeEmpty();
            output.ShouldContain(UnitOfMeasure.kWh);
            output.ShouldContain(UnitOfMeasure.MWh);
            output.ShouldContain(UnitOfMeasure.GWh);
            output.ShouldContain(UnitOfMeasure.Therm);
            output.ShouldContain(UnitOfMeasure.Decatherm);
            output.ShouldContain(UnitOfMeasure.Ccf);
            output.ShouldContain(UnitOfMeasure.Mcf);
        }
Ejemplo n.º 14
0
        public void AesCryptography_ShouldDecryptInputAsExpected_WhenInputIsValid()
        {
            // Arrange
            const string valueToDecrypt = "JunvToRuNjpHAhSKVECm9w==:ZsxfZgMpNEo=";
            const string expectedResult = "encrypt";

            // Act
            string decryptedValue = CUT.Decrypt(valueToDecrypt);

            // Assert
            decryptedValue.ShouldBe(expectedResult);
            decryptedValue.ShouldNotBe(valueToDecrypt);

            // Print
            WriteLine(decryptedValue);
        }
Ejemplo n.º 15
0
        public void AesCryptography_ShouldEncryptInputAsExpected_WhenInputIsValid()
        {
            // Arrange
            const string valueToEncrypt = "encrypt";

            // Act
            string encryptedValue = CUT.Encrypt(valueToEncrypt);
            string decryptedValue = CUT.Decrypt(encryptedValue);

            // Assert
            encryptedValue.ShouldNotBe(valueToEncrypt);
            decryptedValue.ShouldBe(valueToEncrypt);

            // Print
            WriteLine(encryptedValue);
        }
Ejemplo n.º 16
0
 public void Validation_should_only_validate_within_a_specified_group()
 {
     Assert.IsTrue(CUT.Validate(new TestViewModel
     {
         NotNull = "blah",
         NotZero = 1
     }).IsValid);
     Assert.IsFalse(CUT.Validate(new TestViewModel
     {
         NotNull = "blah",
         NotZero = 1
     }, "Test").IsValid);
     Assert.IsTrue(CUT.Validate(new TestViewModel
     {
         NotNull   = "blah",
         NotZero   = 1,
         TestGroup = "foo"
     }, "Test").IsValid);
 }
Ejemplo n.º 17
0
        public void GetAllAccountStatuses_ShouldReturnAllValidValues_UnderAllConditions()
        {
            // Arrange & Act
            AccountStatus[] output = CUT.GetAllAccountStatuses().ToArray();

            // Assert
            output.ShouldNotBeNull();
            output.ShouldNotBeEmpty();
            output.ShouldContain(AccountStatus.Canceled);
            output.ShouldContain(AccountStatus.Closed);
            output.ShouldContain(AccountStatus.DropPending);
            output.ShouldContain(AccountStatus.Duplicate);
            output.ShouldContain(AccountStatus.OffFlow);
            output.ShouldContain(AccountStatus.OnFlow);
            output.ShouldContain(AccountStatus.Pending);
            output.ShouldContain(AccountStatus.Queued);
            output.ShouldContain(AccountStatus.Rejected);
            output.ShouldContain(AccountStatus.Scheduled);
            output.ShouldContain(AccountStatus.Submitted);
        }
Ejemplo n.º 18
0
        public override string ToString()
        {
            s = (CUT)base.Tag;

            Binding myBinding = new Binding("result");

            myBinding.Mode   = BindingMode.TwoWay;
            myBinding.Source = s;
            txtres.SetBinding(TextBox.TextProperty, myBinding);

            Binding myBinding2 = new Binding("variable");

            myBinding2.Mode   = BindingMode.TwoWay;
            myBinding2.Source = s;
            txtvar.SetBinding(TextBox.TextProperty, myBinding2);

            Binding myBinding3 = new Binding("delimiter");

            myBinding3.Mode   = BindingMode.TwoWay;
            myBinding3.Source = s;
            txtdel.SetBinding(TextBox.TextProperty, myBinding3);

            Binding myBinding4 = new Binding("fieldspec");

            myBinding4.Mode   = BindingMode.TwoWay;
            myBinding4.Source = s;
            txtspec.SetBinding(TextBox.TextProperty, myBinding4);


            Binding descbinding = new Binding("Description");

            descbinding.Mode   = BindingMode.TwoWay;
            descbinding.Source = s;
            txtdesc.SetBinding(TextBox.TextProperty, descbinding);


            return(base.ToString());
        }
Ejemplo n.º 19
0
	/*------------------------------------*/
	// アニメーション
	/*------------------------------------*/
	
	// 切り取った後のアニメーション描画関数
	bool AnimationDraw(CUT key)
	{
		// 座標
		float posX = 0;
		float posY = 0;
		// アニメーション中の位置調節用変数
		float adjust_x = 0;
		float adjust_y = 0;
		// マップを切る時の支点
		float pivot_x = 0;
		float pivot_y = 0;
		// 角度
		float rot = 0;
		// アニメーションが終わる角度(演算に使う為 float )
		const float MAX_ROT = 90;
		// 円周率
		const double PI = 3.141592653589793;
		// アニメーションの速度(大きいほど遅い)
		const float ANIMATION_SPEED = 3;
		
		animation_count++;

		// 歯車のアニメーション
		Gear[0].transform.eulerAngles += new Vector3 (0, 0, 0.5f); 
		Gear[1].transform.eulerAngles += new Vector3 (0, 0, -0.665f);
		Gear[2].transform.eulerAngles += new Vector3 (0, 0, 0.5f);
		Gear[3].transform.eulerAngles += new Vector3 (0, 0, -0.5f);

		// 徐々に大きさを変える処理
		buff += buff_difference/(MAX_ROT/ANIMATION_SPEED);
		// 徐々に中心を元に戻す処理
		if (CenterX != 0) {
			CenterX -= CenterDiferenceX /(MAX_ROT/ANIMATION_SPEED);
			if(Mathf.Abs(CenterX) < buff)
				CenterX = 0;
		}
		if (CenterY != 0) {
			CenterY -= CenterDiferenceY /(MAX_ROT/ANIMATION_SPEED);
			if(Mathf.Abs(CenterY) < buff)
				CenterY = 0;
		}

		// 支点と移動距離を確定
		switch(key)
		{
		case CUT.CUT_DOWN:
			// 上から下
			pivot_x = -buff/2;
			pivot_y = -(Map_Y*buff/2+buff/2);
			adjust_y = (next_Map_Y/2+Map_Y/2)/MAX_ROT*buff;
			break;
		case CUT.CUT_UP:
			// 下から上
			pivot_x = -buff/2;
			pivot_y = Map_Y*buff/2-buff/2;
			adjust_y = -(next_Map_Y/2+Map_Y/2)/MAX_ROT*buff;
			break;
		case CUT.CUT_RIGHT:
			// 左から右
			pivot_x = Map_X*buff/2-buff/2;
			pivot_y = -buff/2;
			adjust_x = -(next_Map_X/2+Map_X/2)/MAX_ROT*buff;
			break;
		case CUT.CUT_LEFT:
			// 右から左
			pivot_x = -(Map_X*buff/2+buff/2);
			pivot_y = -buff/2;
			adjust_x = (next_Map_X/2+Map_X/2)/MAX_ROT*buff;
			break;
		}
		
		// クローン操作用変数
		int count = 0;
		
		for (int Y = Map_Y-1; Y >= 0; Y--)
		{
			for (int X = 0; X < Map_X; X++)
			{
				// 傾く方向の確定
				switch(key)
				{
				case CUT.CUT_DOWN:
					// 上から下
					if(X < Map_X/2)
						rot = animation_count*ANIMATION_SPEED;
					else
						rot = -animation_count*ANIMATION_SPEED;
					break;
				case CUT.CUT_UP:
					// 下から上
					if(X < Map_X/2)
						rot = -animation_count*ANIMATION_SPEED;
					else
						rot = animation_count*ANIMATION_SPEED;
					break;
				case CUT.CUT_RIGHT:
					// 左から右
					if(Y < Map_Y/2)
						rot = animation_count*ANIMATION_SPEED;
					else
						rot = -animation_count*ANIMATION_SPEED;
					break;
				case CUT.CUT_LEFT:
					// 右から左
					if(Y < Map_Y/2)
						rot = -animation_count*ANIMATION_SPEED;
					else
						rot = animation_count*ANIMATION_SPEED;
					break;
				}

				// 角度をラジアンに変換
				float radian = (float)(rot * PI / 180.0);
				// アニメーション中の座標に変換
				posX = ((X-Map_X/2)*buff - pivot_x) * Mathf.Cos(radian) - ((Y-Map_Y/2)*buff - pivot_y) * Mathf.Sin(radian) + pivot_x;
				posY = ((X-Map_X/2)*buff - pivot_x) * Mathf.Sin(radian) + ((Y-Map_Y/2)*buff - pivot_y) * Mathf.Cos(radian) + pivot_y;

				// ギミックのアニメーション
				if(Map_Input.mapdata[Y,X] == MAP_GIMMIC.APPEAR){
					for (int i=0; i<MapAction.appear_count; i++) {
						if(Map_Input.appear[i].X == X && Map_Input.appear[i].Y == Y){
							Map_Input.appear[i].number.transform.localPosition = new Vector3(posX+(adjust_x*animation_count*ANIMATION_SPEED)+buff/2, posY+(adjust_y*animation_count*ANIMATION_SPEED)+buff/2, -1);
							Map_Input.appear[i].number.transform.localScale = new Vector3(buff,buff,1);
							Map_Input.appear[i].number.transform.eulerAngles = new Vector3(0,0,rot);
						}
					}
				}	
				if(Map_Input.mapdata[Y,X] == MAP_GIMMIC.DISAPPEAR){
					for (int i=0; i<MapAction.disappear_count; i++) {
						if(Map_Input.disappear[i].X == X && Map_Input.disappear[i].Y == Y){
							Map_Input.disappear[i].number.transform.localPosition = new Vector3(posX+(adjust_x*animation_count*ANIMATION_SPEED)+buff/2, posY+(adjust_y*animation_count*ANIMATION_SPEED)+buff/2, -1);
							Map_Input.disappear[i].number.transform.localScale = new Vector3(buff,buff,1);
							Map_Input.disappear[i].number.transform.eulerAngles = new Vector3(0,0,rot);
						}
					}
				}
				// プレイヤーのアニメーション
				if(X == Player.X && Y == Player.Y){
					N_player.transform.localPosition = new Vector3(posX+(adjust_x*animation_count*ANIMATION_SPEED)+buff/2, posY+(adjust_y*animation_count*ANIMATION_SPEED)+buff/2, -1);
					N_player.transform.localScale = new Vector3(buff,buff,1);
					N_player.transform.eulerAngles = new Vector3(0,0,Player.angle+rot);
				}
				N_block[count].transform.localPosition = new Vector3(posX+(adjust_x*animation_count*ANIMATION_SPEED)+buff/2, posY+(adjust_y*animation_count*ANIMATION_SPEED)+buff/2, -1);
				N_block[count].transform.localScale = new Vector3(buff,buff,1);
				N_block[count].transform.eulerAngles = new Vector3(0,0,rot);
				count++;
			}
		}

		player_draw_flag = false;

		if(animation_count*ANIMATION_SPEED >= MAX_ROT)
		{
			// カウントリセット
			animation_count = 0;
			Player.angle -= rot;
			// アニメーションが終わると終了
			return true;
		}
		// アニメーションが終わっていないので繰り返し
		return false;
	}
Ejemplo n.º 20
0
	// Update is called once per frame
	void Update () {

		if (isStart) {
			MapStart ();
			isStart = false;
		}

		// リスタート時の処理
		if (Setting.isRestart) {
			buff = BUFF_L;
			Trouble = 0;
			AppearGimmicAction ();
			Draw ();
			CameraAction.isStart = true;
		}

		// 更新制御
		if (Setting.isSetting || GameGuide.isGuide || Fade.NowFade != FADE.FADE_NONE)
			return;
		if (Player.clear_flag && Fade.NowFade == FADE.FADE_OUT)
			return;

		// プレイヤーの動きを更新
		move_flag = move_flag | Player.move_flag;

		// プレイヤーの移動などで画面が更新されたら描画しなおす
		if (player_draw_flag)
			PlayerDraw ();
		if (draw_flag)
			Draw ();

		// クリア判定
		if(Player.clear_flag && Fade.NowFade == FADE.FADE_NONE)
			Fade.FadeRun(GAME_SCENE.RESULT);

		// カメラ操作
		if (CameraAction.CameraOn) {
			GameCamera ();
			return;
		}

		// 入力取得
		InputKey ();

		N_GimmickAction ();

		if(animation_flag)
		{
			// プレイヤーの位置調整を元に戻す
			Player.MoveDistance = 0;

			if(AnimationDraw(animation_key))
			{	
				Trouble++;//切った回数	
				animation_flag = false;

				Cut();
				Create(next_Map_X, next_Map_Y, true);
				Copy();
				AppearGimmicAction ();
				// 大きさを調整
				if (Map_X == 8 || Map_Y == 8)
					buff = BUFF_L;
				if (Map_X == 16 || Map_Y == 16)
					buff = BUFF_M;
				if (Map_X == 32 || Map_Y == 32)
					buff = BUFF_S;
				Draw();

				// ステージ1-3で上に切った時に追加でチュートリアル
				if(GameMemory.StagePage == 0 && GameMemory.StageGear == 2){
					if (GameMemory.GuideFlag[6] == 0 && Trouble == 1) {
						GameGuide.NowTutorial = TUTORIAL.STAGE1_3_2;
						GameMemory.GuideFlag[6] = 1;
						GameMain.GuideFlag = true;
					}
				}
			}
		}
		else
			cut_key = CUT.NONE;

		before_key = animation_key;
		move_flag = false;
	}
Ejemplo n.º 21
0
    protected void Button_find_diamonds_Click(object sender, EventArgs e)
    {
        List <string> list_shapes   = new List <string>();
        List <string> list_clarity  = new List <string>();
        List <string> list_color    = new List <string>();
        List <string> list_cut      = new List <string>();
        List <string> list_polish   = new List <string>();
        List <string> list_symmetry = new List <string>();
        List <string> list_lab      = new List <string>();
        double        weightMin;
        double        weightMax;
        double        priceMin;
        double        priceMax;
        string        name;


        #region SHAPE
        List <string> list_shapes_ = s.readfromyDS("Shape");
        foreach (var S in list_shapes_)
        {
            var chk_SHAPE = (HtmlInputCheckBox)SAHPE.FindControl("ShapeCB_" + S.ToString());


            if (chk_SHAPE.Checked == true)
            {
                list_shapes.Add(S.ToString());
            }
        }


        #endregion

        #region Weight

        HtmlInputGenericControl weightMin_control = (HtmlInputGenericControl)WEIGHT.FindControl("weightMin");
        if (weightMin_control.Value == "".ToString())
        {
            weightMin_control.Value = "0.1";
        }
        weightMin = Convert.ToDouble(weightMin_control.Value);

        HtmlInputGenericControl weightMax_control = (HtmlInputGenericControl)WEIGHT.FindControl("weightMax");
        if (weightMax_control.Value == "".ToString())
        {
            weightMax_control.Value = "0.1";
        }
        weightMax = Convert.ToDouble(weightMax_control.Value);

        #endregion

        #region Price

        HtmlInputGenericControl priceMin_control = (HtmlInputGenericControl)WEIGHT.FindControl("priceMin");
        if (priceMin_control.Value == "".ToString())
        {
            priceMin_control.Value = "1";
        }
        priceMin = Convert.ToDouble(priceMin_control.Value.ToString());

        HtmlInputGenericControl priceMax_control = (HtmlInputGenericControl)WEIGHT.FindControl("priceMax");
        if (priceMax_control.Value == "".ToString())
        {
            priceMax_control.Value = "1";
        }
        priceMax = Convert.ToDouble(priceMax_control.Value.ToString());

        #endregion

        #region CLARITY
        List <string> list_clarity_ = s.readfromyDS("Clarity");
        foreach (var C in list_clarity_)
        {
            CheckBox chk_CLARITY = (CheckBox)CLARITY.FindControl("ClarityCB_" + C.ToString());
            if (chk_CLARITY.Checked == true)
            {
                list_clarity.Add(C.ToString());
            }
        }

        #endregion

        #region COLOR
        List <string> list_color_ = s.readfromyDS("Color");
        foreach (var CR in list_color_)
        {
            CheckBox chk_COLOR = (CheckBox)COLOR.FindControl("ColorCB_" + CR.ToString());
            if (chk_COLOR.Checked == true)
            {
                list_color.Add(CR.ToString());
            }
        }

        #endregion

        #region CUT
        List <string> list_cut_ = s.readfromyDS("Cut");
        foreach (var CU_ in list_cut_)
        {
            CheckBox chk_CUT = (CheckBox)CUT.FindControl("CutCB_" + CU_.ToString());
            if (chk_CUT.Checked == true)
            {
                list_cut.Add(CU_.ToString());
            }
        }
        #endregion

        #region POLISH
        List <string> list_polish_ = s.readfromyDS("Polish");
        foreach (var P in list_polish_)
        {
            CheckBox chk_P = (CheckBox)POLISH.FindControl("PolishCB_" + P.ToString());
            if (chk_P.Checked == true)
            {
                list_polish.Add(P.ToString());
            }
        }
        #endregion

        #region SYMMETRY
        List <string> list_symmetry_ = s.readfromyDS("Symmetry");
        foreach (var SYM in list_symmetry_)
        {
            CheckBox chk_SYM = (CheckBox)SYMMETRY.FindControl("SymmetryCB_" + SYM.ToString());
            if (chk_SYM.Checked == true)
            {
                list_symmetry.Add(SYM.ToString());
            }
        }

        #endregion

        #region LAB
        List <string> list_lab_ = s.readfromyDS("Lab");
        foreach (var LAB_ in list_lab_)
        {
            CheckBox chk_LAB = (CheckBox)LAB.FindControl("LabCB_" + LAB_.ToString());
            if (chk_LAB.Checked == true)
            {
                list_lab.Add(LAB_.ToString());
            }
        }

        #endregion

        #region Name

        HtmlInputText txt_name = (HtmlInputText)NAME.FindControl("Search_By_ID".ToString());
        name = txt_name.Value;

        #endregion

        addproducts_after_filter(list_shapes,
                                 list_clarity,
                                 list_color,
                                 list_cut,
                                 list_polish,
                                 list_symmetry,
                                 list_lab,
                                 weightMin,
                                 weightMax,
                                 priceMin,
                                 priceMax,
                                 name);
    }
Ejemplo n.º 22
0
	// 二回呼び出さないために関数名変更
	void MapStart (){

		Destroy (PlayMainObj);
		// 親インスタンス生成
		PlayMainObj = new GameObject();
		PlayMainObj.transform.parent = transform;
		// サイズ調整
		PlayMainObj.transform.localScale = new Vector3 (1,1,1);

		// 各種初期化
		cut_key = CUT.NONE;
		buff = BUFF_L;
		move_flag = false;
		Trouble = 0;
		CenterX = CenterY = 0;
		Player.move_flag = false;
		Player.clear_flag = false;

		// マップ生成
		for (int Y=0; Y<Map_Y; Y++) {
			for (int X=0; X<Map_X; X++) {
				N_block[Y*Map_Y+X] = Instantiate (player, transform.position, Quaternion.identity)as GameObject;
				N_block[Y*Map_Y+X].transform.parent = PlayMainObj.transform;
			}
		}
		// ギミック番号生成
		for (int i=0; i<appear_count; i++) {
			Map_Input.appear[i].number = Instantiate (player, transform.position, Quaternion.identity)as GameObject;
			Map_Input.appear[i].number.transform.parent = PlayMainObj.transform;
		}
		for (int i=0; i<disappear_count; i++) {
			Map_Input.disappear[i].number = Instantiate (player, transform.position, Quaternion.identity)as GameObject;
			Map_Input.disappear[i].number.transform.parent = PlayMainObj.transform;
		}
		// プレイヤー生成
		N_player = Instantiate (player, transform.position, Quaternion.identity)as GameObject;
		N_player.transform.parent = PlayMainObj.transform;

		// 初回描画
		AppearGimmicAction ();
		Draw ();
		PlayerDraw ();

		// チュートリアルの確認
		if (GameMemory.StagePage == 0 && GameMemory.StageGear == 0 && GameMemory.GuideFlag [1] == 0) {
			GameGuide.NowTutorial = TUTORIAL.STAGE1_1;
			GameMemory.GuideFlag [1] = 1;
		}
		if (GameMemory.StagePage == 0 && GameMemory.StageGear == 1 && GameMemory.GuideFlag [3] == 0) {
			GameGuide.NowTutorial = TUTORIAL.STAGE1_2;
			GameMemory.GuideFlag [3] = 1;
		}
		if (GameMemory.StagePage == 0 && GameMemory.StageGear == 2 && GameMemory.GuideFlag [5] == 0) {
			GameGuide.NowTutorial = TUTORIAL.STAGE1_3_1;
			GameMemory.GuideFlag [5] = 1;
		}

		// チュートリアルの表示
		if (GameGuide.NowTutorial != TUTORIAL.NONE)
			GameMain.GuideFlag = true;
	}
Ejemplo n.º 23
0
	// 入力取得関数
	void InputKey(){

		cut_key = CUT.NONE;

		const int MapLimit = 2;			// X軸Y軸の最小値

		// スマホ用の入力取得
		switch (TouchAction.swipe) {
		case SWIPE.NONE:
			cut_key = CUT.NONE;
			break;
		case SWIPE.SWIPE_DOWN:
			if (Map_X > MapLimit)
				cut_key = CUT.CUT_DOWN;
			break;
		case SWIPE.SWIPE_UP:
			if (Map_X > MapLimit)
				cut_key = CUT.CUT_UP;
			break;
		case SWIPE.SWIPE_RIGHT:
			if (Map_Y > MapLimit)
				cut_key = CUT.CUT_RIGHT;
			break;
		case SWIPE.SWIPE_LEFT:
			if (Map_Y > MapLimit)
				cut_key = CUT.CUT_LEFT;
			break;
		}

		// PC用の入力取得
		if (Input.GetKey (KeyCode.W)) {
			if (Map_X > MapLimit)
				cut_key = CUT.CUT_UP;
		}
		if (Input.GetKey (KeyCode.A)) {
			if (Map_Y > MapLimit)
				cut_key = CUT.CUT_LEFT;
		}
		if (Input.GetKey (KeyCode.S)) {
			if (Map_X > MapLimit)
				cut_key = CUT.CUT_DOWN;
		}
		if (Input.GetKey (KeyCode.D)) {
			if (Map_Y > MapLimit)
				cut_key = CUT.CUT_RIGHT;
		}
		// 反発のギミックが稼働していたら元に戻す
		if (magnet_s_count > 0 && !animation_flag) {
			if (S_GimmickCheck ()) {
				// 隣り合っていた場合の元の状態に切りなおす処理
				if (animation_key == CUT.CUT_DOWN) {
					cut_key = CUT.CUT_UP;
				}
				if (animation_key == CUT.CUT_UP) {
					cut_key = CUT.CUT_DOWN;
				}
				if (animation_key == CUT.CUT_LEFT) {
					cut_key = CUT.CUT_RIGHT;
				}
				if (animation_key == CUT.CUT_RIGHT) {
					cut_key = CUT.CUT_LEFT;
				}
			}
		}

		// チュートリアル中の操作制限
		// ステージ1-1をクリアしていない時は切れない
		if (GameMemory.GuideFlag [2] == 0)
			cut_key = CUT.NONE;
		// ステージ1-2は左右にしか切れない
		if (GameMemory.StagePage == 0 && GameMemory.StageGear == 1 && GameMemory.GuideFlag [4] == 0){
			if (cut_key == CUT.CUT_DOWN || cut_key == CUT.CUT_UP){
				cut_key = CUT.NONE;
			}
		}
		// ステージ1-3は上にしか切れない
		if (GameMemory.StagePage == 0 && GameMemory.StageGear == 2 && GameMemory.GuideFlag [7] == 0){
			if (cut_key == CUT.CUT_DOWN || cut_key == CUT.CUT_LEFT || cut_key == CUT.CUT_RIGHT){
				cut_key = CUT.NONE;
			}
			// ランクを獲得してもらうために1回しか切れないようにする
			if(Trouble == 1)
				cut_key = CUT.NONE;
		}

		// 入力取得
		if(cut_key != CUT.NONE && !animation_flag && !move_flag)
		{
			if(cut_key == CUT.CUT_DOWN || cut_key == CUT.CUT_UP)
			{
				// 次のマップの行列を計算
				next_Map_Y = Map_X / 2;
				next_Map_X = Map_Y * 2;
			}
			else
			{
				if(cut_key == CUT.CUT_LEFT || cut_key == CUT.CUT_RIGHT)
				{
					// 次のマップの行列を計算
					next_Map_Y = Map_X * 2;
					next_Map_X = Map_Y / 2;
				}
			}
			PlaySE.isPlayAnimation = true;
			animation_flag = true;
			animation_key = cut_key;
			
			// 切り取った後のブロックのサイズを次のマップのX軸Y軸の数で判定
			if (next_Map_X == 8 || next_Map_Y == 8)
				next_buff = BUFF_L;
			if (next_Map_X == 16 || next_Map_Y == 16)
				next_buff = BUFF_M;
			if (next_Map_X == 32 || next_Map_Y == 32)
				next_buff = BUFF_S;
			
			// サイズの差を絶対値で保存
			buff_difference = next_buff - buff;
		}
	}
 public void Setup()
 {
     cut = new CUT();
 }
        public void Validation_should_all_fail_or_true()
        {
            var model0 = new TestViewModel
            {
                NotNull             = "",
                NotZero             = 0,
                TestGroup           = "",
                TestStringLength    = "123456",
                TestShouldBeLong    = "t",
                TestRange           = 1,
                TestRegex           = "1",
                TestCollectionCount = new List <string> {
                    "1"
                },
            };

            model0.TestNCRequired.Value             = "";
            model0.TestNCFieldStringLength.Value    = "123456";
            model0.TestNCFieldShouldBeLong.Value    = "t";
            model0.TestNCFieldRange.Value           = 1;
            model0.TestNCFieldRegex.Value           = "1";
            model0.TestNCFieldCollectionCount.Value = new List <string> {
                "1"
            };

            var val0 = CUT.Validate(model0, "Test");

            Assert.IsFalse(val0.IsValid);

            var val2 = CUT.Validate(new TestViewModel
            {
                NotNull          = null,
                NotZero          = 0,
                TestGroup        = null,
                TestStringLength = null,
                TestShouldBeLong = null,
                TestRange        = 1,
                TestRegex        = null,
            }, "Test");

            Assert.IsTrue(val2.Count == 6);

            var model1 = new TestViewModel
            {
                NotNull          = "dsf",
                NotZero          = 1,
                TestGroup        = "d",
                TestStringLength = "12345",
                TestShouldBeLong = "12",
                TestRange        = 3,
                TestRegex        = "18700000000",
                //TestCollectionCount = new List<string> { "1", "2" },
            };

            model1.TestNCRequired.Value             = "df";
            model1.TestNCFieldStringLength.Value    = "12345";
            model1.TestNCFieldShouldBeLong.Value    = "12";
            model1.TestNCFieldRange.Value           = 3;
            model1.TestNCFieldRegex.Value           = "18700000000";
            model0.TestNCFieldCollectionCount.Value = new List <string> {
                "1", "2"
            };
            var val1 = CUT.Validate(model1, "Test");

            Assert.IsTrue(val1.IsValid);
        }
Ejemplo n.º 26
0
 public void Validator_scans_the_class_for_attributes()
 {
     Assert.IsNotNull(CUT.Initialize(new TestViewModel()));
 }
Ejemplo n.º 27
0
 public void Validation_should_fail_with_an_empty_object()
 {
     Assert.IsFalse(CUT.Validate(new TestViewModel()).IsValid);
 }
Ejemplo n.º 28
0
 public void Validation_validates_using_the_validation_info()
 {
     Assert.IsNotNull(CUT.Validate(new TestViewModel()));
     Assert.AreEqual(2, CUT.Validate(new TestViewModel()).Count);
 }
Ejemplo n.º 29
0
 public void Validator_creates_a_validation_info_foreach_attributed_property()
 {
     Assert.AreNotEqual(0, CUT.Initialize(new TestViewModel()).Count);
 }