示例#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);
        }
示例#2
0
        public IEnumerable GetChildren(object parent)
        {
            PawnTreeCategory parentCategory = parent == null ? loadedPawnTreeRoot : parent as PawnTreeCategory;

            if (parentCategory != null)
            {
                return(parentCategory.Children);
            }
            return(null);
        }
示例#3
0
 private void SetLoadedPawn(PawnData pawnData)
 {
     loadedPawnData     = pawnData;
     nameParameter      = null;
     loadedPawnTreeRoot = CreatePawnTreeCategory(templatePawnRoot);
 }
示例#4
0
        public bool HasChildren(object parent)
        {
            PawnTreeCategory parentCategory = parent as PawnTreeCategory;

            return(parentCategory != null && parentCategory.Children.Count > 0);
        }
示例#5
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;
        }
示例#6
0
 private void SetLoadedPawn(PawnData pawnData)
 {
     loadedPawnData = pawnData;
     nameParameter = null;
     loadedPawnTreeRoot = CreatePawnTreeCategory(templatePawnRoot);
 }