// createBlueprintScrap public BlueprintScrap createBlueprintScrap(Blueprint blueprint, string uid) { // Check unsaved resources if (isUnsavedResourceUsed(uid)) { System.Windows.Forms.MessageBox.Show(String.Format("An unsaved resource with the uid [{0}] already exists.", uid), "Blueprint Error", System.Windows.Forms.MessageBoxButtons.OK); return null; } BlueprintScrap scrap = new BlueprintScrap(uid); blueprint.scraps.Add(scrap); return scrap; }
// Create from xml public BlueprintSocket(XElement data, BlueprintScrap scrapA, BlueprintScrap scrapB) { _relativePoint = Loader.loadVector2(data.Attribute("relative_point"), Vector2.Zero); _scrapA = scrapA; _scrapB = scrapB; }
// selectBlueprintScrap public void selectBlueprintScrap(BlueprintScrap scrap) { scrapList.SelectedIndex = selectedBlueprint.scraps.IndexOf(scrap); }
// Create new public BlueprintSocket(BlueprintScrap scrapA, BlueprintScrap scrapB, Vector2 relativePoint) { _relativePoint = relativePoint; _scrapA = scrapA; _scrapB = scrapB; }
// connectScrap public void connectScrap(BlueprintScrap scrap) { _connected.Add(scrap); }