void FormSmartEditorShow() { if (formSmart.ShowDialog() == DialogResult.OK) { PlaceOperation OperationTemp = new PlaceOperation(PlaceOperation.Kind.PastePlace, MyMapEditor); int CountTemp = formSmart.DesBrushRanc.Count; for (int i = 0; i <= CountTemp - 1; ++i) { int IndexTemp = formSmart.DesBrushRanc[i].clickindex; OperationTemp.Items.Add(IndexTemp); if (formSmart.DesBrushRanc[i].color == SmartEditor.ColorBlock[0].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); NowSE.Start(MapStructureKind.Water, formSmart.DesBrushRanc, i); } if (formSmart.DesBrushRanc[i].color == SmartEditor.ColorBlock[1].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); NowSE.Start(MapStructureKind.Magma, formSmart.DesBrushRanc, i); } if (formSmart.DesBrushRanc[i].color == SmartEditor.ColorBlock[2].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); NowSE.Start(MapStructureKind.Ice, formSmart.DesBrushRanc, i); } if (formSmart.DesBrushRanc[i].color == SmartEditor.ColorBlock[3].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); //NowSE.Start(MapStructureKind.Universe, Form_Temp, i); } if (formSmart.DesBrushRanc[i].color == SmartEditor.ColorBlock[4].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); NowSE.Start(MapStructureKind.MountainTop, formSmart.DesBrushRanc, i); } } OnceOperation.Redo(OperationTemp); MapPlaceCom(); formSmart.Close(); } }
private void 智能连接ToolStripMenuItem_Click(object sender, EventArgs e) { List <PointBrush> DesBrushRanc = new List <PointBrush>(); int WaterMin = (int)MapIdDefine.水面Start; int WaterMax = (int)MapIdDefine.水面End; int MagmaMin = (int)MapIdDefine.岩浆Start; int MagmaMax = (int)MapIdDefine.岩浆End; SmartEditor.ColorBlock.Clear(); for (int i = 0; i < 6; ++i) { SmartEditor.ColorBlock.Add(new PictureBox()); } SmartEditor.ColorBlock[0].BackColor = Color.Blue; SmartEditor.ColorBlock[1].BackColor = Color.Red; SmartEditor.ColorBlock[2].BackColor = Color.LightBlue; SmartEditor.ColorBlock[3].BackColor = Color.Gray; SmartEditor.ColorBlock[4].BackColor = Color.Yellow; SmartEditor.ColorBlock[5].BackColor = Color.LightCyan; for (int i = 0; i < MapPanelEditor.PictureTotal; ++i) { int index = MyMapEditor.MapImage2Int(MyMapEditor.MapIMG_Block[i]); if (MyPublicFuntion.MathFunctionDefine.IsInRange(index, WaterMin, WaterMax) == true) { int xnum = i / 40 + 1; int ynum = i % 40 + 1; DesBrushRanc.Add(new PointBrush(new Point(xnum, ynum), SmartEditor.ColorBlock[0].BackColor, i)); } else if (MyPublicFuntion.MathFunctionDefine.IsInRange(index, MagmaMin, MagmaMax) == true) { int xnum = i / 40 + 1; int ynum = i % 40 + 1; DesBrushRanc.Add(new PointBrush(new Point(xnum, ynum), SmartEditor.ColorBlock[1].BackColor, i)); } } PlaceOperation OperationTemp = new PlaceOperation(PlaceOperation.Kind.PastePlace, MyMapEditor); int CountTemp = DesBrushRanc.Count; for (int i = 0; i <= CountTemp - 1; ++i) { int IndexTemp = DesBrushRanc[i].clickindex; OperationTemp.Items.Add(IndexTemp); if (DesBrushRanc[i].color == SmartEditor.ColorBlock[0].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); NowSE.Start(MapStructureKind.Water, DesBrushRanc, i); } if (DesBrushRanc[i].color == SmartEditor.ColorBlock[1].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); NowSE.Start(MapStructureKind.Magma, DesBrushRanc, i); } if (DesBrushRanc[i].color == SmartEditor.ColorBlock[2].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); NowSE.Start(MapStructureKind.Ice, DesBrushRanc, i); } if (DesBrushRanc[i].color == SmartEditor.ColorBlock[3].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); //NowSE.Start(MapStructureKind.Universe, Form_Temp, i); } if (DesBrushRanc[i].color == SmartEditor.ColorBlock[4].BackColor) { SmartEditor NowSE = new SmartEditor(MyMapEditor); NowSE.Start(MapStructureKind.MountainTop, DesBrushRanc, i); } } OnceOperation.Redo(OperationTemp); MapPlaceCom(); }