public void PrepareStoryEvent(StoryEvent storyEvent, Stats stats)
        {
            storyEvent.DisplayText = string.Empty;

            foreach (var append in storyEvent.DisplayAppendText)
            {
                storyEvent.DisplayText += textTransformer.TransformText(append, stats);
                storyEvent.DisplayText += DisplayConstants.BreakBetweenInfoBlocks;
            }

            storyEvent.DisplayText += textTransformer.TransformText(storyEvent.RawText, stats);
            storyEvent.DisplayText += new ReferenceEntryDescriptionProcessor().ProcessDescriptionFromReferenceEntries(storyEvent.RawReferenceEntries);

            storyEvent.ButtonText = textTransformer.TransformText(storyEvent.RawButtonText, stats);

            if (string.IsNullOrEmpty(storyEvent.ButtonText))
            {
                storyEvent.ButtonText = DisplayConstants.DefaultButtonText(storyEvent.Type);
            }

            foreach (var choice in storyEvent.RawChoices)
            {
                ChoicePreparer.PrepareChoice(choice, stats);
            }
        }
Exemple #2
0
 public StoryEvent FindEvent(Story story, string storyEventId)
 {
     return(story.AllEvents.SingleOrDefault(se => se.Id == storyEventId) ?? DisplayConstants.ErrorMessage($"Story event with ID \"<i>{storyEventId}</i>\" not found"));
 }