protected StoryVar visited(params string[] passageNames) { if (passageNames == null || passageNames.Length == 0) { passageNames = new string[] { this.CurrentPassage.Name } } ; int min = int.MaxValue; for (int i = 0; i < passageNames.Length; i++) { string passage = passageNames[i]; int count = PassageHistory.Where(p => p == passage).Count(); if (passage == this.CurrentPassage.Name) { count++; } if (count < min) { min = count; } } if (min == int.MaxValue) { min = 0; } return(min); }
protected StoryVar visitedTag(params string[] tags) { if (tags == null || tags.Length == 0) { return(0); } int min = int.MaxValue; for (int i = 0; i < tags.Length; i++) { string tag = tags[i]; int count = PassageHistory.Where(p => Passages[p].Tags.Contains(tag)).Count(); if (CurrentPassage.Tags.Contains(tag)) { count++; } if (count < min) { min = count; } } if (min == int.MaxValue) { min = 0; } return(min); }