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


C# NetworkReader.ReadUInt32方法代码示例

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


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

示例1: ClientVC

    public ClientVC(NetworkReader nr)
        : base(new Vec2i(0,0), 0)
    {
        this.data = new VesselTile[VesselChunk.DATA_COUNT];

        index.x = nr.ReadInt32();
        index.y = nr.ReadInt32();

        version = nr.ReadUInt32();
        tileCount = nr.ReadInt32();

        for (int i = 0; i < tileCount; i++) {
            //read in vessel tile
            Vec2i tileI;

            tileI.x = nr.ReadInt32();
            tileI.y = nr.ReadInt32();
            FloorType floor0 = (FloorType)nr.ReadByte();
            FloorType floor1 = (FloorType)nr.ReadByte();
            WallTypeMask wallMask = (WallTypeMask)nr.ReadByte();
            bool wallNode = nr.ReadBoolean();

            VesselTile tile = new VesselTile(wallMask, wallNode, floor0, floor1, (uint)VesselTile.FLAGS.NONE);

            SetTile(tileI, tile);
        }
    }
开发者ID:NickPowers43,项目名称:SW,代码行数:27,代码来源:ClientVC.cs

示例2: ReadChunkRequest

    private ServerVC ReadChunkRequest(NetworkReader nr)
    {
        Vec2i index;
        index.x = nr.ReadInt32();
        index.y = nr.ReadInt32();

        uint version = nr.ReadUInt32();

        if (version == uint.MaxValue) {
            return (ServerVC)chunks.TryGet(index);
        } else {
            ServerVC vc = (ServerVC)chunks.TryGet(index);

            if (version != vc.version) {
                return vc;
            } else {
                return null;
            }
        }
    }
开发者ID:NickPowers43,项目名称:SW,代码行数:20,代码来源:ServerVessel.cs

示例3: UnpackBits

    private uint[] UnpackBits(NetworkReader reader,
                              params uint[] lengths)
    {
        int offset = 0;
        uint final = reader.ReadUInt32();

        uint[] values = new uint[lengths.Length];

        for (int i = 0; i < lengths.Length; ++i)
        {
            int length = (int) lengths[i];
            uint mask = ((uint) 1 << length) - 1;

            values[i] = (final & (mask << offset)) >> offset;

            offset += length;
        }

        return values;
    }
开发者ID:Ragzouken,项目名称:smooltool,代码行数:20,代码来源:Test.cs


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