• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TagNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: LoadTree

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

            _tile = ctree["Tile"].ToTagByte();

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


示例17: LoadTree

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

            TagNodeList items = ctree["Items"].ToTagList();
            _items = _items.LoadTree(items);

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


示例18: LoadTree

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

            _eggTime = ctree["EggLayTime"].ToTagInt();

            return this;
        }
开发者ID:tofurama3000,项目名称:substrate-minecraft,代码行数:12,代码来源:EntityChicken.cs


示例19: LoadTree

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

            _inData = ctree["inData"].ToTagByte();
            _player = ctree["player"].ToTagByte();

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


示例20: LoadTree

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

            _life = ctree["Lifetime"].ToTagInt();
            _player = ctree["PlayerSpawned"].ToTagByte() == 1;

            return this;
        }
开发者ID:tofurama3000,项目名称:substrate-minecraft,代码行数:12,代码来源:EntityEndermite.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TagType类代码示例发布时间:2022-05-24
下一篇:
C# TagModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap