示例#1
0
        public void AddChild(string parentName, Entity entity)
        {
            if (Type != Types.PARENT && Type != Types.ARRAY && Type != Types.REPEAT)
            {
                throw new Exception($"{parentName} must have type Parent, Array or Repeat to add child entities");
            }

            // Make sure name does not already exist
            if (ChildEntities.ContainsKey(entity.Name))
            {
                throw new Exception($"{parentName} defines attribute {entity.Name} multiple times");
            }

            ChildEntities.Add(entity.Name, entity);
            ChildOrder.Add(entity.Name);
        }
示例#2
0
 public void AddChild(EntityManager.Entity entity)
 {
     ChildEntities.Add(entity);
 }