/// <summary> /// Retrieves the instance of the Controller object /// </summary> /// <param name="parent">The handle to the view</param> /// <param name="radius">Radius to draw everything at on the graph</param> /// <returns>A reference to the controller singleton</returns> public static Controller GetInstance(ExampleWindow parent, int radius) { if (instance == null) { instance = new Controller(parent, radius); } return instance; }
/// <summary> /// Constructor to create the initial instance of the controller singleton /// </summary> /// <param name="parent">Handle to a view window</param> /// <param name="radius">Radius to draw nodes and lines at</param> private Controller(ExampleWindow parent, int radius) { algorithm = null; view = parent; maxX = parent.ModelOutput.Width; maxY = parent.ModelOutput.Height; this.nodeRadius = radius; model = new MasterModel(parent, nodeRadius); }