fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace うちぱんnav
  12. {
  13. public partial class Form1 : Form
  14. {
  15. StateControl state = new StateControl();
  16.  
  17. Font f = new Font("MSゴシック", 32);
  18.  
  19. Bitmap bgTitle = new Bitmap("タイトル画面.png");
  20. Bitmap bgMain = new Bitmap("メイン画面.png");
  21.  
  22. Bitmap bmp;
  23.  
  24. string str;
  25.  
  26.  
  27.  
  28.  
  29.  
  30. public Form1()
  31. {
  32. InitializeComponent();
  33. }
  34.  
  35. private void Form1_Load(object sender, EventArgs e)
  36. {
  37. switch (state.getState()){
  38. case StateControl.State.MAIN:
  39.  
  40. break;
  41. }
  42. }
  43. //これからソースが長くなるところ 始まり?--------------------------------------------------------------------------------------------
  44. private void Form1_KeyDown(object sender, KeyEventArgs e)
  45. {
  46. switch (e.KeyCode)
  47. {
  48. case Keys.X:
  49. if (state.getState()== StateControl.State.TITLE) {
  50. }
  51. else{state.backState();
  52. }
  53. break;
  54. case Keys.Z: state.nextState(); break;
  55. }
  56. Refresh();
  57. }
  58.  
  59. private void Form1_Paint(object sender, PaintEventArgs e)
  60. {
  61. Graphics g = e.Graphics;
  62. switch (state.getState())
  63. {
  64. case StateControl.State.TITLE:
  65. bmp = bgTitle;
  66. // g.DrawImage(bgTitle, 0, 0, bgTitle.Width, bgTitle.Height);
  67. str = "TITLE";
  68. break;
  69.  
  70. case StateControl.State.MAIN:
  71. bmp = bgMain;
  72. // g.DrawImage(bgMain, 0, 0, bgMain.Width, bgMain.Height);
  73. str = "MAIN";
  74. break;
  75.  
  76. case StateControl.State.SELECT:
  77. str = "SELECT";
  78. break;
  79.  
  80. case StateControl.State.PLAY:
  81. str = "PLAY";
  82. break;
  83.  
  84. case StateControl.State.REZULT:
  85. str = "REZULT";
  86. break;
  87.  
  88. }
  89. g.DrawImage(bmp, 0, 0, bmp.Width, bmp.Height);
  90. g.DrawString("press Z key", f, Brushes.White,180,300); //とりあえずここに
  91. g.DrawString(str, f, Brushes.White, 540, 400);
  92. //これからソースが長くなるところ 終わり?--------------------------------------------------------------------------------------------
  93. }
  94. }
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. public class StateControl
  106. {
  107. public enum State
  108. {
  109. NONE = -1,
  110. TITLE = 0,
  111. MAIN,
  112. SELECT,
  113. PLAY,
  114. REZULT,
  115. NUM
  116. };
  117. private State state;
  118.  
  119. public enum ModeSelect
  120. {
  121. NONE = -1,
  122. VS2P = 0,
  123. VSCPU,
  124. OPTION,
  125. NUM
  126. };
  127. private ModeSelect modeselect;
  128.  
  129.  
  130.  
  131. public StateControl()
  132. {
  133. state = State.TITLE;
  134. modeselect = ModeSelect.VS2P;
  135. }
  136.  
  137.  
  138. public void setState(State s)
  139. {
  140. state = s;
  141. }
  142.  
  143. public void nextState()
  144. {
  145. if (state >= State.NUM)
  146. {
  147. state = State.MAIN;
  148. }
  149. }
  150.  
  151. public void backState()
  152. {
  153. if (state <= State.TITLE)
  154. {
  155. state = State.MAIN;
  156. }
  157. }
  158.  
  159. public void setMode(ModeSelect m)
  160. {
  161. modeselect = m;
  162. }
  163.  
  164.  
  165. public State getState()
  166. {
  167. return state;
  168. }
  169.  
  170. public ModeSelect getMode()
  171. {
  172. return modeselect;
  173. }
  174. }
  175. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(4,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing `System.Data' assembly reference?
prog.cs(9,22): error CS0234: The type or namespace name `Forms' does not exist in the namespace `System.Windows'. Are you missing `System.Windows.Forms' assembly reference?
prog.cs(13,34): error CS0246: The type or namespace name `Form' could not be found. Are you missing an assembly reference?
prog.cs(44,51): error CS0246: The type or namespace name `KeyEventArgs' could not be found. Are you missing an assembly reference?
prog.cs(59,49): error CS0246: The type or namespace name `PaintEventArgs' could not be found. Are you missing an assembly reference?
Compilation failed: 5 error(s), 0 warnings
stdout
Standard output is empty