void AssignDataToNodes(SilkStory newSilkStory, SilkNode newNode, string newTweeData, string newPassage, string storyTitle) { newNode.nodeName = storyTitle + "_" + ReturnTitle(newTweeData).TrimEnd(' '); //only to remove it when required in GetNodeName newNode.StoryName = storyTitle; //add custom tag names // //TODO TEST //newNode.tags = ReturnCustomTags(newTweeData); //add custom tags //TODO process tags just in time, rather than doing a tag-pass /* * foreach (KeyValuePair<string, string[]> tagName in newNode.tags) { * * string newTagName = ""; * //Right now, you can't use underscores in your custom tag names * if (tagName.Key.Contains("_")) { * newTagName = tagName.Key.Remove(tagName.Key.IndexOf('_')).TrimStart().TrimEnd(); * } * if (tagFactory.SetTag(newTagName, tagName.Value) != null) { * newNode.silkTags.Add(tagFactory.SetTag(newTagName, tagName.Value)); * } * else { * Debug.LogError(newTagName + " is not a recognized tag. Check your TagFactory"); * } * } */ //Debug.Log(newNode.silkTags[0].TagName); //add passage newNode.nodePassage = newPassage; //TODO Add the correct amount of links to the list //add link names //Debug.Log(ReturnLinks(newTweeData).Count); newNode.links = ReturnLinks(newTweeData); newSilkStory.AddToStory(newNode.nodeName, newNode); }
void AssignDataToNodes(SilkStory newSilkStory, SilkNode newNode, string newTweeData, string newPassage, string storyTitle) { //TODO figure out where this g----Title is started newNode.nodeName = storyTitle + "_" + ReturnTitle(newTweeData).TrimEnd(' '); //only to remove it when required in GetNodeName newNode.StoryName = storyTitle; //add custom tag names newNode.tags = ReturnCustomTags(newTweeData); //add custom tags foreach (KeyValuePair <string, string[]> tagName in newNode.tags) { string newTagName = ""; //Right now, you can't use underscores in your custom tag names if (tagName.Key.Contains("_")) { newTagName = tagName.Key.Remove(tagName.Key.IndexOf('_')).TrimStart().TrimEnd(); } if (tagFactory.SetTag(newTagName, tagName.Value) != null) { newNode.silkTags.Add(tagFactory.SetTag(newTagName, tagName.Value)); } else { Debug.LogError(newTagName + " is not a recognized tag. Check your TagFactory"); } } //Debug.Log(newNode.silkTags[0].TagName); //add passage newNode.nodePassage = newPassage; //TODO Add the correct amount of links to the list //add link names newNode.links = ReturnLinks(newTweeData); newSilkStory.AddToStory(newNode.nodeName, newNode); }