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


C# MapPoint.Dump方法代码示例

本文整理汇总了C#中MapPoint.Dump方法的典型用法代码示例。如果您正苦于以下问题:C# MapPoint.Dump方法的具体用法?C# MapPoint.Dump怎么用?C# MapPoint.Dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MapPoint的用法示例。


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

示例1: Parse

        public BlockFile Parse()
        {

            BlockFile result = new BlockFile();

            result.header.facet=br.ReadByte();
            result.header.FileID = br.ReadUInt16();

            fileid = result.header.FileID;

            if (output != null)
                WriteFileOut(result.header.Dump());

            mp = new MapPoint();
            mp.offsetx = 0;
            mp.x = AdjustX(0);
            mp.offsety = 0;
            mp.y = AdjustY(0);
            mp.lt = ReadLandtile();


            ushort currentx=0;
            ushort currenty=0;

            byte type1,type2;
            while (br.BaseStream.Position < br.BaseStream.Length - 3)
            {
                type1 = br.ReadByte();
                type2 = br.ReadByte();
                if (type1 == 0 && type2 == 0) //Landtile
                {
                    currenty++;
                    if (currenty == BLOCK_HEIGHT)
                    {
                        currentx++;
                        currenty = 0;
                        if (currentx >= BLOCK_WIDTH)
                            WriteFileErr("FileID=" + fileid + ", ERROR X is too huge: " + currentx);
                    }
                    if ((mp.delimiter_list.Count > 0 && delimitercheck) || (mp.static_list.Count > 0 && staticcheck) || (mp.delimiter_list.Count == 0 && mp.static_list.Count == 0 && tilecheck))
                    {
                        if(!writeonlyfiles)
                            result.blocks.Add(mp);
                        if(output!=null)
                            WriteFileOut(mp.Dump());
                    }
                    mp = new MapPoint();
                    mp.offsetx = currentx;
                    mp.x = AdjustX(currentx);
                    mp.offsety = currenty;
                    mp.y = AdjustY(currenty);
                    mp.lt=ReadLandtile();
                }
                else if (type1 == 0 && type2 != 0) //Static
                {
                    for (int i = 0; i < type2; i++)
                    {
                        if (i > 0)
                        {
                            ushort zero = br.ReadUInt16();
                            if (zero != 0)
                                WriteFileErr("FileID=" + fileid + ", X=" + AdjustX(currentx) + " (offset " + currentx + "), Y=" + AdjustY(currenty) + " (offset " + currenty + "), error static header placeholder zero byte is not zero: " + zero);
                        }
                        mp.static_list.Add(ReadStatic());
                    }
                }
                else if (type1 > 0)
                {
                    br.BaseStream.Position--;
                    for (int i = 0; i < type1; i++)
                    {
                        if (i > 0)
                        {
                            byte zero = br.ReadByte();
                            if (zero != 0)
                                WriteFileErr("FileID=" + fileid + ", X=" + AdjustX(currentx) + " (offset " + currentx + "), Y=" + AdjustY(currenty) + " (offset " + currenty + "), error delimiter type1 placeholder zero byte is not zero: " + zero);
                        }
                        mp.delimiter_list.Add(ReadDelimiter());
                    }
                }
                else
                    WriteFileErr("FileID=" + fileid + ", ERROR Type undefined, type1:" + type1 + ", type2:" + type2);
            }
            if ((mp.delimiter_list.Count > 0 && delimitercheck) || (mp.static_list.Count > 0 && staticcheck) || (mp.delimiter_list.Count == 0 && mp.static_list.Count == 0 && tilecheck))
            {
                if (!writeonlyfiles)
                    result.blocks.Add(mp);
                if (output != null)
                    WriteFileOut(mp.Dump());
            }
            br.Close();
            return result;
        }
开发者ID:cbnolok,项目名称:SphereSvrSource,代码行数:93,代码来源:Parser.cs


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