From 9db658f3623c0fe02a0d51a402581248e45ca45b Mon Sep 17 00:00:00 2001 From: Tim Young Date: Thu, 24 Aug 2017 20:03:00 -0500 Subject: [PATCH] initial stubs for creating a random network --- EduNetworkBuilder/NetworkBuilder.Designer.cs | 12 +++++++++++- EduNetworkBuilder/NetworkBuilder.cs | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/EduNetworkBuilder/NetworkBuilder.Designer.cs b/EduNetworkBuilder/NetworkBuilder.Designer.cs index 9b769cd..0311062 100644 --- a/EduNetworkBuilder/NetworkBuilder.Designer.cs +++ b/EduNetworkBuilder/NetworkBuilder.Designer.cs @@ -75,6 +75,7 @@ this.HelpPanel = new System.Windows.Forms.Panel(); this.cbViewTitles = new System.Windows.Forms.CheckBox(); this.myProgressBar = new System.Windows.Forms.ProgressBar(); + this.randomToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.msMainMenuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pbNetworkView)).BeginInit(); this.HelpPanel.SuspendLayout(); @@ -332,7 +333,8 @@ this.samplesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.puzzlesToolStripMenuItem, this.solvedToolStripMenuItem, - this.toSolveToolStripMenuItem}); + this.toSolveToolStripMenuItem, + this.randomToolStripMenuItem}); this.samplesToolStripMenuItem.Name = "samplesToolStripMenuItem"; this.samplesToolStripMenuItem.Size = new System.Drawing.Size(77, 24); this.samplesToolStripMenuItem.Text = "Samples"; @@ -506,6 +508,13 @@ this.myProgressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous; this.myProgressBar.TabIndex = 11; // + // randomToolStripMenuItem + // + this.randomToolStripMenuItem.Name = "randomToolStripMenuItem"; + this.randomToolStripMenuItem.Size = new System.Drawing.Size(181, 26); + this.randomToolStripMenuItem.Text = "Random"; + this.randomToolStripMenuItem.Click += new System.EventHandler(this.randomToolStripMenuItem_Click); + // // BuilderWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -588,6 +597,7 @@ private System.Windows.Forms.ToolStripMenuItem submitHomeworkToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem markAsGradedToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem logoutToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem randomToolStripMenuItem; } } diff --git a/EduNetworkBuilder/NetworkBuilder.cs b/EduNetworkBuilder/NetworkBuilder.cs index 5089110..e7f8712 100644 --- a/EduNetworkBuilder/NetworkBuilder.cs +++ b/EduNetworkBuilder/NetworkBuilder.cs @@ -2132,5 +2132,24 @@ namespace EduNetworkBuilder if(InvisibleNetwork == null) return false; return true; } + + + #region Random Map Stuff + private void randomToolStripMenuItem_Click(object sender, EventArgs e) + { + GenerateARandomMap(); + } + + private void GenerateARandomMap() + { + LoadSolvedRandomMap(); + } + + private void LoadSolvedRandomMap() + { + //we will prompt for stuff. For now, just use the firewalls network + LoadSolvedResource( SolvedNetworkNames.firewalls.ToString()); + } + #endregion Random Map Stuff } } \ No newline at end of file