public CookDetailView(MabiCooker Main, CookData Exchange, ListBox FavView) { InitializeComponent(); this.MainWindow = Main; this.CookInfo = Exchange; this.FavListView = FavView; UpdateData(this.CookInfo); }
private void GenerateNewData() { currentData = nextData; //TODO 生成新Data int tempRandomInt; do { tempRandomInt = Random.Range(1, System.Enum.GetValues(typeof(UnitType)).Length); }while (tempRandomInt == randomInt); randomInt = tempRandomInt; nextData = new CookData((UnitType)randomInt); }
private void bBack_Click(object sender, EventArgs e) { if (ForTrace.Count != 0) { CookInfo = ForTrace.Pop(); UpdateData(CookInfo); CookRatioView.SelectedCook = CookInfo.cook; CookRatioView.DataIndex = CookInfo.cIndex; if (MabiCooker.RatioView != null) { MabiCooker.RatioView.UpdateData(); } if (ForTrace.Count == 0) { bBack.Enabled = false; } } }
private void lCopyrites_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (File.Exists("supervisor.tag")) { for (int i = 0; i < CookData.Count; i++) { CookImplement.CookData buffer = new CookData(CookData, StuffData, i); int[] sRatio = buffer.cook.getRatio(); int[] cEffect = buffer.cook.getEffectArray(); bool cSEffectbool = false; if (buffer.cook.SEffect != "") { cSEffectbool = true; } string query = String.Format("INSERT INTO `mabicooker`.`mc_cooks` " + "(`name`, `rank`, `ratio_1`, `ratio_2`, `ratio_3`, `effect_0`, `effect_1`, `effect_2`, `effect_3`, `effect_4`, `effect_5`, `effect_6`, `effect_7`, `effect_8`, `effect_9`, `effect_10`, `isSpecial`, `effect_special`, `stuff_1`, `stuff_2`, `stuff_3`) " + "VALUES ('{0}', '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, '{17}', {18}, {19}, {20})", buffer.cook.Name, buffer.cook.Rank, sRatio[0], sRatio[1], sRatio[2], cEffect[0], cEffect[1], cEffect[2], cEffect[3], cEffect[4], cEffect[5], cEffect[6], cEffect[7], cEffect[8], cEffect[9], cEffect[10], cSEffectbool, buffer.cook.SEffect, buffer.stuffs[0]); } } if (File.Exists("supervisor.tag")) { // File.Copy("cook.dat", "cook_prev_ver.dat"); // StreamWriter data = new StreamWriter("cook.dat"); StreamWriter data = new StreamWriter("stuff_anlysis.dat"); List <String> stuffs = new List <String>(); Action <String> writefile = data.WriteLine; for (int i = 0; i < CookData.Count; i++) { string[] buffer = CookData[i].Stuff; for (int k = 0; k < buffer.Length; k++) { if (!stuffs.Contains(buffer[k])) { stuffs.Add(buffer[k]); } } } stuffs.Sort(); stuffs.ForEach(writefile); // MessageBox.Show("데이터 정렬이 완료 되었습니다.", "관리자 알림"); MessageBox.Show("재료 데이터 출력이 완료 되었습니다.", "관리자 알림", MessageBoxButtons.OK, MessageBoxIcon.Information); data.Close(); } else if (File.Exists("listclear.tag") && !File.Exists("CookData.xml")) { DataTable tblCook = new DataTable("tblCook"); DataTable tblStuff = new DataTable("tblStuff"); DataColumn col; // DataRow row; col = new DataColumn("No", typeof(int)); col.Unique = true; col.AutoIncrement = true; tblCook.Columns.Add(col); col = new DataColumn("Name", typeof(string)); col.Unique = true; tblCook.Columns.Add(col); col = new DataColumn("Rank", typeof(string)); col.MaxLength = 1; tblCook.Columns.Add(col); col = new DataColumn("Stuff", typeof(string[])); tblCook.Columns.Add(col); col = new DataColumn("Ratio", typeof(int[])); tblCook.Columns.Add(col); col = new DataColumn("Effect", typeof(int[])); tblCook.Columns.Add(col); col = new DataColumn("SpecialEffect", typeof(string)); tblCook.Columns.Add(col); col = new DataColumn("No", typeof(int)); col.Unique = true; col.AutoIncrement = true; tblStuff.Columns.Add(col); } else { System.Diagnostics.Process.Start("http://dehol.kr"); return; } }
public void UpdateData(CookData Exchange) { // Initialize Text lStuffOne.Text = ""; lStuffOnePrice.Text = ""; lStuffTwo.Text = ""; lStuffTwoPrice.Text = ""; lStuffThree.Text = ""; lStuffThreePrice.Text = ""; lStuffThree.Visible = false; try { this.CookInfo = Exchange; bBack.Enabled = (this.ForTrace.Count == 0) ? false : true; // 이전 요리 스택에 뭔가 있으면 버튼 활성화 this.Text = CookInfo.cook.getName(); if (CookInfo.stuffs[0] != null) { lStuffOne.Text = CookInfo.stuffs[0].sName; CheckStuff(CookInfo.stuffs[0], lStuffOne, lStuffOnePrice); } else { lStuffOne.Text = "Unknown Error"; } if (CookInfo.stuffs[1] != null) { lStuffTwo.Text = CookInfo.stuffs[1].sName; CheckStuff(CookInfo.stuffs[1], lStuffTwo, lStuffTwoPrice); } else { lStuffTwo.Text = "Unknown Error"; } if ((CookInfo.cook.getRatio())[0] == 230) { this.Text += Properties.Resources.StrCannotCook; } if (CookInfo.stuffs[2] != null) { lStuffThree.Text = CookInfo.stuffs[2].sName; CheckStuff(CookInfo.stuffs[2], lStuffThree, lStuffThreePrice); lStuffThree.Visible = true; } else { lStuffThree.Text = "Unknown Error"; } bModFav_Icon(); lEffects.Text = CookInfo.cook.getEffect(); var RankId = CookInfo.cook.getRank(); lRank.Text = RankId.ToString(); lPicture.Image = CookImplement.Rank.getRankBitmap(RankId); this.message = CookImplement.Rank.getRankName(RankId); lMessage.Text = this.message; } catch (IndexOutOfRangeException e) { CookImplement.Dialog.ErrorDialog error = new CookImplement.Dialog.ErrorDialog(null, e.StackTrace); error.ShowDialog(); } }