Example #1
0
 public static MvcHtmlString RenderDescription(NpcModel model)
 {
     var paragraph = new TagBuilder("p");
     var firstOrDefault = model.Demeanour.FirstOrDefault();
     if (firstOrDefault != null)
     {
         var quirkModel = model.Quirks.FirstOrDefault();
         if (quirkModel != null)
             paragraph.InnerHtml = string.Format(
                 "{0} is {1} {2} {3} {4}, hailing from {5}, distinguished from others because {6} {7}.",
                 model.Name,
                 firstOrDefault.Description.WithArticle(),
                 EnumExtensions.ToName(model.Age).ToLower(),
                 model.RaceModel.Name,
                 model.Class.Name,
                 model.Location.Name,
                 model.Pers(),
                 quirkModel.
                     Description.NotCap().Genderize(model.Gender)
                 );
     }
     return MvcHtmlString.Create(paragraph.ToString());
 }
Example #2
0
 public static string DescriptionPronounify(this string str, NpcModel model)
 {
     return str.Replace("{pos}", model.Poss())
         .Replace("{per}", model.Pers())
         .Replace("{per true}", model.Pers(true));
 }