当前位置: 首页>>代码示例>>C#>>正文


C# TagNode类代码示例

本文整理汇总了C#中TagNode的典型用法代码示例。如果您正苦于以下问题:C# TagNode类的具体用法?C# TagNode怎么用?C# TagNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TagNode类属于命名空间,在下文中一共展示了TagNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteNbtTag

        private void WriteNbtTag (StreamWriter writer, TagNode tag)
        {
            if (tag == null)
                return;

            writer.Write(JSONSerializer.Serialize(tag));
        }
开发者ID:DMV-Jumbo,项目名称:NBTExplorer,代码行数:7,代码来源:JsonOperation.cs

示例2: GetTagNodeText

        public static string GetTagNodeText(TagNode tag)
        {
            if (tag == null)
                return null;

            switch (tag.GetTagType())
            {
                case TagType.TAG_BYTE:
                case TagType.TAG_SHORT:
                case TagType.TAG_INT:
                case TagType.TAG_LONG:
                case TagType.TAG_FLOAT:
                case TagType.TAG_DOUBLE:
                case TagType.TAG_STRING:
                    return tag.ToString();

                case TagType.TAG_BYTE_ARRAY:
                    return tag.ToTagByteArray().Length + " bytes";

                case TagType.TAG_LIST:
                    return tag.ToTagList().Count + " entries";

                case TagType.TAG_COMPOUND:
                    return tag.ToTagCompound().Count + " entries";
            }

            return null;
        }
开发者ID:ImaginaryDevelopment,项目名称:NBTExplorer,代码行数:28,代码来源:SubstrateHelper.cs

示例3: DeleteTag

        public bool DeleteTag (TagNode tag)
        {
            bool result = _tag.Remove(tag);
            if (result)
                SetModified();

            return result;
        }
开发者ID:DMV-Jumbo,项目名称:NBTExplorer,代码行数:8,代码来源:ListTagContainer.cs

示例4: DeleteTag

        public bool DeleteTag(TagNode tag)
        {
            foreach (String name in _tag.Keys)
                if (_tag[name] == tag)
                    return _tag.Remove(name);

            return false;
        }
开发者ID:JLChnToZ,项目名称:Taggy,代码行数:8,代码来源:CompoundTagContainer.cs

示例5: InsertTag

        public bool InsertTag(TagNode tag, int index)
        {
            if (index < 0 || index > _tag.Count)
                return false;

            _tag.Insert(index, tag);
            return true;
        }
开发者ID:hach-que,项目名称:NBTExplorer,代码行数:8,代码来源:ListTagContainer.cs

示例6: GetTagName

        public string GetTagName(TagNode tag)
        {
            foreach (String name in _tag.Keys)
                if (_tag[name] == tag)
                    return name;

            return null;
        }
开发者ID:JLChnToZ,项目名称:Taggy,代码行数:8,代码来源:CompoundTagContainer.cs

示例7: AddTag

        public bool AddTag(TagNode tag, string name)
        {
            if (_tag.ContainsKey(name))
                return false;

            _tag.Add(name, tag);
            return true;
        }
开发者ID:JLChnToZ,项目名称:Taggy,代码行数:8,代码来源:CompoundTagContainer.cs

示例8: LoadTree

        public override TypedEntity LoadTree(TagNode tree)
        {
            TagNodeCompound ctree = tree as TagNodeCompound;
            if (ctree == null || base.LoadTree(tree) == null) {
                return null;
            }

            return this;
        }
开发者ID:vfioox,项目名称:ENULib,代码行数:9,代码来源:EntitySilverfish.cs

示例9: AppendTag

        public bool AppendTag (TagNode tag)
        {
            if (_tag.ValueType != tag.GetTagType())
                return false;

            _tag.Add(tag);

            SetModified();
            return true;
        }
开发者ID:DMV-Jumbo,项目名称:NBTExplorer,代码行数:10,代码来源:ListTagContainer.cs

示例10: LoadTree

        public override TileEntity LoadTree(TagNode tree)
        {
            TagNodeCompound ctree = tree as TagNodeCompound;
            if (ctree == null || base.LoadTree(tree) == null) {
                return null;
            }

            _command = ctree["Command"].ToTagString();

            return this;
        }
开发者ID:vfioox,项目名称:ENULib,代码行数:11,代码来源:TileEntityControl.cs

示例11: LoadTree

        public override TypedEntity LoadTree (TagNode tree)
        {
            TagNodeCompound ctree = tree as TagNodeCompound;
            if (ctree == null || base.LoadTree(tree) == null) {
                return null;
            }

            _profession = ctree["Profession"].ToTagInt();

            return this;
        }
开发者ID:tofurama3000,项目名称:Substrate,代码行数:11,代码来源:EntityVillager.cs

示例12: RenameTag

        public bool RenameTag(TagNode tag, string name)
        {
            if (_tag.ContainsKey(name))
                return false;

            string oldName = GetTagName(tag);
            _tag.Remove(oldName);
            _tag.Add(name, tag);

            return true;
        }
开发者ID:JLChnToZ,项目名称:Taggy,代码行数:11,代码来源:CompoundTagContainer.cs

示例13: LoadTree

        public override EntityTyped LoadTree(TagNode tree)
        {
            TagNodeCompound ctree = tree as TagNodeCompound;
            if (ctree == null || base.LoadTree(tree) == null) {
                return null;
            }

            _saddle = ctree["Saddle"].ToTagByte() == 1;

            return this;
        }
开发者ID:jamesphenry,项目名称:ForgeCraft,代码行数:11,代码来源:EntityPig.cs

示例14: LoadTree

        public override EntityTyped LoadTree(TagNode tree)
        {
            TagNodeCompound ctree = tree as TagNodeCompound;
            if (ctree == null || base.LoadTree(tree) == null) {
                return null;
            }

            _size = ctree["Size"].ToTagInt();

            return this;
        }
开发者ID:jamesphenry,项目名称:ForgeCraft,代码行数:11,代码来源:EntitySlime.cs

示例15: LoadTree

        public override TypedEntity LoadTree(TagNode tree)
        {
            TagNodeCompound ctree = tree as TagNodeCompound;
            if (ctree == null || base.LoadTree(tree) == null) {
                return null;
            }

            _anger = ctree["Anger"].ToTagShort();

            return this;
        }
开发者ID:vfioox,项目名称:ENULib,代码行数:11,代码来源:EntityPigZombie.cs


注:本文中的TagNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。