//──────────────────────────────────────── /// <summary> /// コンストラクター。 /// </summary> public Memory_GameController() { this.keyCnf = new KeyconfigPadImpl(); this.buttonsFrame = new int[4 + this.KeyCnf.NCount_MaxButton + 1]; this.buttonsPressingFrame = new int[4 + this.KeyCnf.NCount_MaxButton + 1]; this.nKeyRepeatFrames = int.MaxValue; // 3; this.enumCurKeyForCnf = EnumGamepadkeyBit.Up; }
//──────────────────────────────────────── public static string ToString_Display(EnumGamepadkeyBit enumBit) { string sResult; switch (enumBit) { case EnumGamepadkeyBit.Up: sResult = "↑"; break; case EnumGamepadkeyBit.Right: sResult = "→"; break; case EnumGamepadkeyBit.Down: sResult = "↓"; break; case EnumGamepadkeyBit.Left: sResult = "←"; break; case EnumGamepadkeyBit.A: sResult = "A"; break; case EnumGamepadkeyBit.B: sResult = "B"; break; case EnumGamepadkeyBit.X: sResult = "X"; break; case EnumGamepadkeyBit.Y: sResult = "Y"; break; case EnumGamepadkeyBit.L: sResult = "L"; break; case EnumGamepadkeyBit.R: sResult = "R"; break; case EnumGamepadkeyBit.Start: sResult = "Start"; break; case EnumGamepadkeyBit.Select: sResult = "Select"; break; default: // エラー sResult = "<エラー>"; break; } return sResult; }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public void Open(int nPlayer, KeyconfigPadImpl keycnfPad, out string sErrorMsg) { TextBox pctxt; switch (nPlayer) { case 2: pctxt = this.textBox2; break; case 3: pctxt = this.textBox3; break; case 4: pctxt = this.textBox4; break; default: pctxt = this.textBox1; break; } // 1~12 for (int nNum = 1; nNum < 13; nNum++) { EnumGamepadkeyIx enumGa = Utility_KeyconfigArray.IntTo(nNum); EnumGamepadkeyBit enumGp = keycnfPad.KeyconfigArray[(int)enumGa]; switch (enumGp) { case EnumGamepadkeyBit.Up: // [↑] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.Right: // [→] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.Down: // [↓] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.Left: // [←] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.A: // [A] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.B: // [B] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.X: // [X] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.Y: // [Y] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.L: // [L] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.R: // [R] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.Start: // [Start] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; case EnumGamepadkeyBit.Select: // [Select] pctxt.Text += Utility_KeyconfigArray.ToString_Display(enumGa); break; default: break; } } sErrorMsg = ""; return; }
//──────────────────────────────────────── static public string ToString_Display(EnumGamepadkeyBit enumBit) { string sResult; switch (enumBit) { case EnumGamepadkeyBit.Up: sResult = "↑"; break; case EnumGamepadkeyBit.Right: sResult = "→"; break; case EnumGamepadkeyBit.Down: sResult = "↓"; break; case EnumGamepadkeyBit.Left: sResult = "←"; break; case EnumGamepadkeyBit.A: sResult = "A"; break; case EnumGamepadkeyBit.B: sResult = "B"; break; case EnumGamepadkeyBit.X: sResult = "X"; break; case EnumGamepadkeyBit.Y: sResult = "Y"; break; case EnumGamepadkeyBit.L: sResult = "L"; break; case EnumGamepadkeyBit.R: sResult = "R"; break; case EnumGamepadkeyBit.Start: sResult = "Start"; break; case EnumGamepadkeyBit.Select: sResult = "Select"; break; default: // エラー sResult = "<エラー>"; break; } return(sResult); }
//──────────────────────────────────────── static public string GetShortString(EnumGamepadkeyBit enumBit) { string s; switch (enumBit) { case EnumGamepadkeyBit.Up: s = "↑"; break; case EnumGamepadkeyBit.Right: s = "→"; break; case EnumGamepadkeyBit.Down: s = "↓"; break; case EnumGamepadkeyBit.Left: s = "←"; break; case EnumGamepadkeyBit.A: s = "A"; break; case EnumGamepadkeyBit.B: s = "B"; break; case EnumGamepadkeyBit.X: s = "X"; break; case EnumGamepadkeyBit.Y: s = "Y"; break; case EnumGamepadkeyBit.L: s = "L"; break; case EnumGamepadkeyBit.R: s = "R"; break; case EnumGamepadkeyBit.Select: s = "Se"; break; case EnumGamepadkeyBit.Start: s = "St"; break; default: s = ""; break; } return(s); }
//──────────────────────────────────────── #endregion #region アクション //──────────────────────────────────────── public void Open(int nPlayer, KeyconfigPadImpl keycnfPad, out string sErrorMsg) { Usercontrol_VwdKeycnf ucGmctrlOneCnf = this.usercontrol_VwdKeycnfArray[nPlayer]; // 1~12 for (int nNum = 1; nNum < 13; nNum++) { EnumGamepadkeyIx gaEnum = Utility_KeyconfigArray.IntTo(nNum); EnumGamepadkeyBit gpEnum = keycnfPad.KeyconfigArray[(int)gaEnum]; switch (gpEnum) { case EnumGamepadkeyBit.Up: // [↑] ucGmctrlOneCnf.PctxtUp.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.Right: // [→] ucGmctrlOneCnf.PctxtRight.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.Down: // [↓] ucGmctrlOneCnf.PctxtDown.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.Left: // [←] ucGmctrlOneCnf.PctxtLeft.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.A: // [A] ucGmctrlOneCnf.PctxtA.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.B: // [B] ucGmctrlOneCnf.PctxtB.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.X: // [X] ucGmctrlOneCnf.PctxtX.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.Y: // [Y] ucGmctrlOneCnf.PctxtY.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.L: // [L] ucGmctrlOneCnf.PctxtL.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.R: // [R] ucGmctrlOneCnf.PctxtR.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.Start: // [Start] ucGmctrlOneCnf.PctxtStart.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; case EnumGamepadkeyBit.Select: // [Select] ucGmctrlOneCnf.PctxtSelect.Text = Utility_KeyconfigArray.ToString_Display(gaEnum); break; default: break; } } sErrorMsg = ""; return; }
//──────────────────────────────────────── public static string GetShortString(EnumGamepadkeyBit enumBit) { string s; switch(enumBit) { case EnumGamepadkeyBit.Up: s = "↑"; break; case EnumGamepadkeyBit.Right: s = "→"; break; case EnumGamepadkeyBit.Down: s = "↓"; break; case EnumGamepadkeyBit.Left: s = "←"; break; case EnumGamepadkeyBit.A: s = "A"; break; case EnumGamepadkeyBit.B: s = "B"; break; case EnumGamepadkeyBit.X: s = "X"; break; case EnumGamepadkeyBit.Y: s = "Y"; break; case EnumGamepadkeyBit.L: s = "L"; break; case EnumGamepadkeyBit.R: s = "R"; break; case EnumGamepadkeyBit.Select: s = "Se"; break; case EnumGamepadkeyBit.Start: s = "St"; break; default: s = ""; break; } return s; }