Example #1
0
        private PawnTreeCategory CreatePawnTreeCategory(PawnTemplateCategory templateCategory)
        {
            PawnTreeCategory ret = new PawnTreeCategory { Template = templateCategory };
            foreach (PawnTemplateElement childTemplateElement in templateCategory.Children)
            {
                PawnTreeElement childTreeElement = null;

                PawnTemplateParameter childTemplateParameter = childTemplateElement as PawnTemplateParameter;
                if (childTemplateParameter != null)
                {
                    childTreeElement = CreatePawnTreeParameter(childTemplateParameter);
                }
                else
                {
                    PawnTemplateCategory childTemplateCategory = childTemplateElement as PawnTemplateCategory;
                    childTreeElement = CreatePawnTreeCategory(childTemplateCategory);
                }

                ret.Children.Add(childTreeElement);
            }
            return ret;
        }
Example #2
0
 private void SetLoadedPawn(PawnData pawnData)
 {
     loadedPawnData = pawnData;
     nameParameter = null;
     loadedPawnTreeRoot = CreatePawnTreeCategory(templatePawnRoot);
 }