/// <summary> /// Converts this object to a full debug string /// </summary> /// <returns></returns> public string ToStringFull() { StringBuilder builder = new StringBuilder(); if (mutationCategories != null) { builder.AppendLine($"{nameof(mutationCategories)}:[{mutationCategories.Join(d => d.defName)}]"); } if (morphCategories != null) { builder.AppendLine($"{nameof(morphCategories)}:[{morphCategories.Join(d => d.defName)}]"); } builder.AppendLine($"{nameof(morphs)}:[{morphs.Join(d => d.defName)}]"); //all morph info builder.AppendLine($"---Full Morph Info, total count{AllMorphs.Count}---"); builder.AppendLine($"[{AllMorphs.Join(m => m.defName + "/" + m.label)}]"); //total mutation info builder.AppendLine($"---Full Mutation Info, total count={AllMutations.Count()}, {nameof(pickAnyMutation)}:{pickAnyMutation}---"); builder.AppendLine($"[{AllMutations.Join(m => m.defName)}]"); return(builder.ToString()); }
private void GetMorphMutations([NotNull] List <MutationDef> mutations) { if (!AllMutations.Any()) { return; } MorphDef rMorph = AllMorphs.RandElement(); mutations.AddRange(rMorph.AllAssociatedMutations); }
IEnumerable <MutationDef> GetAllMutations() { foreach (MutationDef mutation in AllMorphs.SelectMany(allMorph => allMorph.AllAssociatedMutations)) { yield return(mutation); } foreach (MutationDef mutation in mutationCategories.MakeSafe().SelectMany(m => m.AllMutations)) { yield return(mutation); } }