本文整理汇总了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);
}
}
示例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;
}
}
}
示例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;
}