public void Add(CutChip s) { if (s == null) { return; } if (!ChipS.Contains(s)) { s.Index = Count; ChipS.Add(s); } }
private List <ChipS> GetListMake(int many) { List <ChipS> chipSList1 = new List <ChipS>(); List <ChipS> chipSList2 = new List <ChipS>(); List <ChipS> chipSList3 = new List <ChipS>(); for (int index = 1; index < byte.MaxValue; ++index) { ChipFolder chipFolder = new ChipFolder(this.sound); chipFolder.SettingChip(index); if (!(chipFolder.chip is DammyChip)) { if (this.savedata.datelist[index - 1]) { chipSList2.Add(new ChipS(index, 0)); } else { chipSList3.Add(new ChipS(index, 0)); } } } for (int index = 0; index < many; ++index) { int num1 = this.Random.Next(1000) / 10; int num2 = this.treader != Chiptreader.Treader.Normal ? (num1 >= 40 ? (num1 >= 70 ? (num1 >= 90 ? (num1 >= 99 ? 5 : 4) : 3) : 2) : 1) : (num1 >= 60 ? (num1 >= 90 ? 3 : 2) : 1); List <ChipS> chipSList4 = new List <ChipS>(); List <ChipS> chipSList5 = new List <ChipS>(); foreach (ChipS chipS in chipSList3) { if (num2 == chipS.Reality) { chipSList4.Add(chipS); } } foreach (ChipS chipS in chipSList2) { if (num2 == chipS.Reality) { chipSList5.Add(chipS); } } ChipS chipS1 = (this.Random.Next(100) >= 25 || chipSList4.Count <= 0) && chipSList5.Count > 0 ? chipSList5[this.Random.Next(chipSList5.Count)] : chipSList4[this.Random.Next(chipSList4.Count)]; chipS1.code = this.Random.Next(4); chipSList1.Add(chipS1); } return(chipSList1); }
public override void InitCutRunData(bool create = true) { this.Center = Globals.TabCenter; SetStyle(CutState.Complate | CutState.Cutting | CutState.Pause, false); chipChannel.Clear(); if (create) { preCut.InitPreDataSpeed(); //初始化预划切速度 } if (!Multiple) //加工一片 { ChipS.Clear(); this.LeftTopPoint.X = Center.X - Length / 2; //配置左上角坐标X this.LeftTopPoint.Y = Center.Y - Width / 2; //配置 base.InitCutRunData(create); chipChannel.AddRange(CHs); //任意通道模式 if (!Order) { chipChannel.Reverse(); //逆序 } } else//加工多片 { foreach (var item in chipS)//多片划切 { item.CutDir = CutDir; item.CutMode = item.CutMode;//切割模式 item.Order = Order; item.BackSpeed = BackSpeed; item.InitCutRunData(create); if (OncePiece) //一次划切一片 { if (Order) // 顺序 { chipChannel.Add(item.CH1); chipChannel.Add(item.CH2); } else//逆序 { chipChannel.Add(item.CH2); chipChannel.Add(item.CH1); } } else //一次划切多通道 { if (Order) { chipChannel.Add(item.CH1); } else { chipChannel.Add(item.CH2); } } } if (!OncePiece) // 每次划切通整个通道 { foreach (var item in chipS) //添加所有片的第二通道 { if (Order) { chipChannel.Add(item.CH2); } else { chipChannel.Add(item.CH1); } } } } chipChannel.RemoveAll(c => c.Enable == false);//实际划切片数要移除未使能的通道 }
public bool Remove(CutChip c) { return(ChipS.Remove(c)); }
private void BuyEvent() { string str1 = ""; string str2 = ""; switch (this.shopType) { case 0: if (this.goods[this.Select].numberNo > 0) { ChipS chipS = new ChipS(this.goods[this.Select].numberNo, this.goods[this.Select].numberSub); str1 = chipS.Name; str2 = chipS.Code == 26 ? " *" : " " + Enum.GetName(typeof(ChipFolder.CODE), (ChipFolder.CODE)chipS.Code); this.price = this.goods[this.Select].price; break; } str1 = ShanghaiEXE.Translate("Shop.HPMemory"); this.price = this.goods[this.Select].price + this.goods[this.Select].numberSub * this.savedata.ShopCount[this.shopNo, this.Select]; break; case 1: str1 = SubChip.NameSet(this.goods[this.Select].numberNo); this.price = SubChip.PriceSet(this.goods[this.Select].numberNo) - this.goods[this.Select].numberSub; break; case 2: str1 = AddOnBase.AddOnSet(this.goods[this.Select].numberNo, this.goods[this.Select].numberSub).name; if (this.goods[this.Select].numberSub > 0) { str2 = " " + AddOnBase.ColorToString(this.goods[this.Select].numberSub); } this.price = this.goods[this.Select].price; break; case 3: str1 = Shop.INTERIOR.GetItem(this.goods[this.Select].numberNo); this.price = this.goods[this.Select].price; break; } this.eventmanager.events.Clear(); if (this.moneyType == 0) { var question = new Dialogue(); var options = ShanghaiEXE.Translate("Shop.ZennyOptions"); switch (this.assistant) { case 0: question = ShanghaiEXE.Translate("Shop.Assistant1ZennyDialogue1QuestionFormat").Format(str1, str2, this.price); break; case 1: question = ShanghaiEXE.Translate("Shop.Assistant2ZennyDialogue1QuestionFormat").Format(str1, str2, this.price); break; case 2: question = ShanghaiEXE.Translate("Shop.Assistant3ZennyDialogue1QuestionFormat").Format(str1, str2, this.price); break; case 3: question = ShanghaiEXE.Translate("Shop.Assistant4ZennyDialogue1QuestionFormat").Format(str1, str2, this.price); break; } this.eventmanager.AddEvent(new Question(this.sound, this.eventmanager, question[0], question[1], options[0], options[1], true, true, faceSeet, this.faceNo, this.savedata)); } else { var question = new Dialogue(); var options = ShanghaiEXE.Translate("Shop.OtherOptions"); switch (this.assistant) { case 0: question = ShanghaiEXE.Translate("Shop.Assistant1OtherDialogue1QuestionFormat").Format(str1, str2); break; case 1: question = ShanghaiEXE.Translate("Shop.Assistant2OtherDialogue1QuestionFormat").Format(str1, str2); break; case 2: question = ShanghaiEXE.Translate("Shop.Assistant3OtherDialogue1QuestionFormat").Format(str1, str2); break; case 3: question = ShanghaiEXE.Translate("Shop.Assistant4OtherDialogue1QuestionFormat").Format(str1, str2); break; } this.eventmanager.AddEvent(new Question(this.sound, this.eventmanager, question[0], question[1], options[0], options[1], true, true, faceSeet, this.faceNo, this.savedata)); } this.yesnoSelect = true; }
public override void Render(IRenderer dg) { if (this.shopmode) { this.field.back.Render(dg); this._rect = new Rectangle(656, 0, 160, 104); this._position = new Vector2(0.0f, 0.0f); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); Vector2 point; for (int index = 0; index < Math.Min(5, this.goods.Length); ++index) { int num = 0; Color color = Color.White; if (this.goods[this.top + index].stock > 0 && this.savedata.ShopCount[this.shopNo, this.top + index] >= this.goods[this.top + index].stock) { color = Color.Gray; } switch (this.shopType) { case 0: if (this.goods[this.top + index].numberNo > 0) { ChipS chipS = new ChipS(this.goods[this.top + index].numberNo, this.goods[this.top + index].numberSub); AllBase.NAME[] nameArray = this.Nametodata(chipS.Name); point = new Vector2(16f, 12 + index * 16); this._position = new Vector2(point.X, point.Y); DrawBlockCharacters(dg, nameArray, 16, this._position, color, out this._rect, out this._position); this._position = new Vector2(88f, 12 + 16 * index); this._rect = new Rectangle(chipS.Code * 8, 32, 8, 16); dg.DrawImage(dg, "font", this._rect, true, this._position, color); num = this.goods[this.top + index].price; break; } AllBase.NAME[] nameArray1 = this.Nametodata(ShanghaiEXE.Translate("Shop.HPMemory")); point = new Vector2(16f, 12 + index * 16); this._position = new Vector2(point.X, point.Y); DrawBlockCharacters(dg, nameArray1, 16, this._position, color, out this._rect, out this._position); num = this.goods[this.top + index].price + this.goods[this.top + index].numberSub * this.savedata.ShopCount[this.shopNo, index]; if (this.savedata.ShopCount[this.shopNo, this.top + index] >= this.goods[this.top + index].stock) { num -= this.goods[this.top + index].numberSub; } break; case 1: AllBase.NAME[] nameArray2 = this.Nametodata(SubChip.NameSet(this.goods[this.top + index].numberNo)); point = new Vector2(16f, 12 + index * 16); this._position = new Vector2(point.X, point.Y); DrawBlockCharacters(dg, nameArray2, 16, this._position, color, out this._rect, out this._position); num = SubChip.PriceSet(this.goods[this.top + index].numberNo) - this.goods[this.top + index].numberSub; break; case 2: AllBase.NAME[] nameArray3 = this.Nametodata(AddOnBase.AddOnSet(this.goods[this.top + index].numberNo, this.goods[this.top + index].numberSub).name); point = new Vector2(16f, 12 + index * 16); this._position = new Vector2(point.X, point.Y); DrawBlockCharacters(dg, nameArray3, 16, this._position, color, out this._rect, out this._position); AllBase.NAME[] nameArray4 = this.Nametodata(AddOnBase.ColorToAlphabet(this.goods[this.top + index].numberSub)); point = new Vector2(88f, 12 + index * 16); this._position = new Vector2(point.X, point.Y); DrawBlockCharacters(dg, nameArray4, 16, this._position, color, out this._rect, out this._position); num = this.goods[this.top + index].price; break; case 3: point = new Vector2(16f, 14 + index * 16); ++point.X; ++point.Y; dg.DrawMiniText(Shop.INTERIOR.GetItem(this.goods[this.top + index].numberNo), point, Color.FromArgb(32, 32, 32)); --point.X; --point.Y; dg.DrawMiniText(Shop.INTERIOR.GetItem(this.goods[this.top + index].numberNo), point, Color.White); num = this.goods[this.top + index].price; break; } this._position = new Vector2(8f, 12 + 16 * index); AllBase.NAME[] nameArray5 = this.moneyType != 0 ? this.Nametodata(num.ToString()) : this.Nametodata(num.ToString() + "Z"); point = new Vector2(152 - nameArray5.Length * 8, 12 + index * 16); foreach (var data in ((IEnumerable <AllBase.NAME>)nameArray5).Select((v, j) => new { v, j })) { this._rect = new Rectangle((int)data.v * 8, 16, 8, 16); this._position = new Vector2(point.X + 8 * data.j, point.Y); dg.DrawImage(dg, "font", this._rect, true, this._position, color); } } this._rect = new Rectangle(240 + 16 * this.cursolanime, 48, 16, 16); this._position = new Vector2(0.0f, 12 + this.cursol * 16); dg.DrawImage(dg, "window", this._rect, true, this._position, Color.White); float num1 = this.overTop != 0 && this.top != 0 ? 80f / overTop * top : 0.0f; this._rect = new Rectangle(176, 168, 8, 8); this._position = new Vector2(152f, 8f + num1); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); if (this.top > 0) { this._rect = new Rectangle(160 + 8 * this.cursolanime, 208, 8, 8); this._position = new Vector2(84f, 4f); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); } if (this.top < this.overTop) { this._rect = new Rectangle(184 + 8 * this.cursolanime, 208, 8, 8); this._position = new Vector2(84f, 92f); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); } this._rect = new Rectangle(0, 0, 240, 56); this._position = new Vector2(0.0f, 104f); dg.DrawImage(dg, "window", this._rect, true, this._position, Color.White); if (!this.help) { this._position = new Vector2(5f, 108f); this._rect = new Rectangle(0, faceNo * 48, 40, 48); string te = "Face" + this.faceSeet.ToString(); dg.DrawImage(dg, te, this._rect, true, this._position, Color.White); if (!this.eventmanager.playevent) { for (int index = 0; index < this.massage.Length; ++index) { this._position = new Vector2(48f, 108 + 16 * index); dg.DrawText(this.massage[index], this._position, this.savedata); } } } else { string[] strArray = new string[3] { "", "", "" }; switch (this.shopType) { case 0: if ((uint)this.goods[this.Select].numberNo > 0U) { ChipFolder chipFolder = new ChipFolder(null); chipFolder.SettingChip(this.goods[this.Select].numberNo); this._position = new Vector2(80f, 8f); if (chipFolder.chip.dark) { this._rect = new Rectangle(848, 216, 80, 96); } else if (chipFolder.chip.navi) { this._rect = new Rectangle(848, 120, 80, 96); } else { this._rect = new Rectangle(680, 120, 80, 96); } dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); this._position = new Vector2(89f, 25f); chipFolder.chip.GraphicsRender(dg, this._position, this.goods[this.Select].numberSub, true, true); strArray = chipFolder.chip.information; break; } var dialogue = ShanghaiEXE.Translate("Shop.HPMemoryDescriptionDialogue1"); strArray[0] = dialogue[0]; strArray[1] = dialogue[1]; break; case 1: strArray = SubChip.InfoSet(this.goods[this.Select].numberNo); break; case 2: AddOnBase addOnBase = AddOnBase.AddOnSet(this.goods[this.Select].numberNo, this.goods[this.Select].numberSub); addOnBase.Render(dg, false, false, new Vector2(72f, 40f), this); strArray = addOnBase.infomasion; break; } for (int index = 0; index < strArray.Length; ++index) { this._position = new Vector2(48f, 108 + 16 * index); dg.DrawText(strArray[index], this._position, this.savedata); } } switch (this.moneyType) { case 0: this._rect = new Rectangle(488, 232, 80, 40); this._position = new Vector2(160f, 0.0f); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); break; case 1: this._rect = ShanghaiEXE.language == 1 ? new Rectangle(800, 712, 80, 40) : new Rectangle(712, 712, 80, 40); this._position = new Vector2(160f, 0.0f); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); break; case 2: this._rect = ShanghaiEXE.language == 1 ? new Rectangle(800, 752, 80, 40) : new Rectangle(720, 752, 80, 40); this._position = new Vector2(160f, 0.0f); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); break; case 3: this._rect = ShanghaiEXE.language == 1 ? new Rectangle(800, 792, 80, 40) : new Rectangle(720, 792, 80, 40); this._position = new Vector2(160f, 0.0f); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); break; } if (this.moneyType == 0) { if (this.savedata.Money < this.savedata.moneyover) { AllBase.NAME[] nameArray = this.Nametodata(this.savedata.Money.ToString() + "Z"); point = new Vector2(232 - nameArray.Length * 8, 16f); foreach (var data in ((IEnumerable <AllBase.NAME>)nameArray).Select((v, j) => new { v, j })) { this._rect = new Rectangle((int)data.v * 8, 88, 8, 16); this._position = new Vector2(point.X + 8 * data.j, point.Y); dg.DrawImage(dg, "font", this._rect, true, this._position, Color.White); } } else { this._position = new Vector2(164f, 16f); this.TextRender(dg, ShanghaiEXE.Translate("Shop.Billionaire"), false, this._position, false); } } else if (this.savedata.havePeace[this.moneyType - 1] < this.savedata.moneyover) { AllBase.NAME[] nameArray = this.Nametodata(string.Format(ShanghaiEXE.Translate("Shop.ZennyFormat"), this.savedata.havePeace[this.moneyType - 1])); point = new Vector2(232 - nameArray.Length * 8, 16f); this._position = new Vector2(point.X, point.Y); DrawBlockCharacters(dg, nameArray, 88, this._position, Color.White, out this._rect, out this._position); } else { this._position = new Vector2(164f, 16f); this.TextRender(dg, ShanghaiEXE.Translate("Shop.Billionaire"), false, this._position, false); } this._rect = new Rectangle(432, 232, 56, 40); this._position = new Vector2(176f, 56f); dg.DrawImage(dg, "menuwindows", this._rect, true, this._position, Color.White); } if (this.eventmanager.playevent) { this.eventmanager.Render(dg); } if (this.alpha <= 0) { return; } Color color1 = Color.FromArgb(alpha, Color.Black); Rectangle _rect = new Rectangle(0, 0, 240, 160); Vector2 _point = new Vector2(0.0f, 0.0f); dg.DrawImage(dg, "fadescreen", _rect, true, _point, color1); }