/// <summary> /// Form1内でキーを押したときに実行されます。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void KeyDown(object sender, KeyEventArgs e) { e.SuppressKeyPress = true; ClickField.PushKey(e.KeyCode); AgentsActivityData = ClickField.AgentsActivityData; Showing(); }
/// <summary> /// Procon29_Showの初期化を行います。 /// </summary> /// <param name="procon29_Calc">表示する計算機</param> /// <param name="pictureBox">表示するピクチャボックス</param> public Show(Calc procon29_Calc, PictureBox pictureBox) { Calc = procon29_Calc; PictureBox = pictureBox; // ResourceManagerを取得する System.Resources.ResourceManager resource = Properties.Resources.ResourceManager; //画像ファイルを読み込んで、Imageオブジェクトとして取得する AgentBitmap = new Bitmap[2]; AgentBitmap[0] = (Bitmap)resource.GetObject("Orange"); AgentBitmap[1] = (Bitmap)resource.GetObject("Lime"); FairyBitmap = new Bitmap[4]; FairyBitmap[0] = (Bitmap)resource.GetObject("Strawberry"); FairyBitmap[1] = (Bitmap)resource.GetObject("Apple"); FairyBitmap[2] = (Bitmap)resource.GetObject("Kiwi"); FairyBitmap[3] = (Bitmap)resource.GetObject("Muscat"); foreach (Team team in Enum.GetValues(typeof(Team))) { foreach (AgentNumber agent in Enum.GetValues(typeof(AgentNumber))) { AgentsActivityData[team, agent] = new AgentActivityData(AgentStatusCode.RequestMovement, Calc.Agents[team, agent].Position); } } ClickField = new ClickField(Calc, PictureBox); DrawField = new DrawField(Calc, new Bitmap(pictureBox.Width, pictureBox.Height)); }
public void ClickShow() { ClickField.Click(); AgentsActivityData = ClickField.AgentsActivityData; }