Ejemplo n.º 1
0
        private void saveWithNameMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog();
            String current = Directory.GetCurrentDirectory();
            dialog.InitialDirectory = current + @"\projects\" + projectName + @"\data";
            dialog.FileName = "samplefloor.bin";

            if(dialog.ShowDialog() == DialogResult.OK) {
                //editorの設定
                EditorConfig editorConfig = new EditorConfig();
                editorConfig.drawFloorModel = drawFloorModel;
                editorConfig.showAlwaysFloorMap = showAlwaysFloorMap;
                editorConfig.lockMapSize = !mapSizeX.Enabled;
                editorConfig.mapXsize = floorMap.getXsize();
                editorConfig.mapYsize = floorMap.getYsize();

                List<List<Boolean>> xb = new List<List<bool>>();
                foreach(List<MapEdge> ll in floorMap.MapPosition.EdgeXList) {
                    List<Boolean> l = new List<Boolean>();
                    foreach(MapEdge me in ll) {
                        l.Add(me.Enabled);
                    }
                    xb.Add(l);
                }
                editorConfig.edgeXListEnable = xb;

                List<List<Boolean>> yb = new List<List<bool>>();
                foreach(List<MapEdge> ll in floorMap.MapPosition.EdgeYList) {
                    List<Boolean> l = new List<bool>();
                    foreach(MapEdge me in ll) {
                        l.Add(me.Enabled);
                    }
                    yb.Add(l);
                }
                editorConfig.edgeYListEnable = yb;

                editorConfig.encounterRatio = (int)encountRatioUpDown.Value;

                editorConfig.toFile(dialog.FileName);
            }
        }