本文整理汇总了C#中Chunk.GetStream方法的典型用法代码示例。如果您正苦于以下问题:C# Chunk.GetStream方法的具体用法?C# Chunk.GetStream怎么用?C# Chunk.GetStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chunk
的用法示例。
在下文中一共展示了Chunk.GetStream方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MapChunk
public MapChunk(ADT adt, Chunk chunk)
{
ADT = adt;
Source = chunk;
var stream = chunk.GetStream();
Header = new MapChunkHeader();
Header.Read(stream);
stream.Seek(chunk.Offset, SeekOrigin.Begin);
GenerateVertices(stream);
}
示例2: MapChunk
public MapChunk(ADT adt, Chunk chunk, bool isObj0 = false)
{
ADT = adt;
Chunk = chunk;
var stream = chunk.GetStream();
if (adt.Type == ADTType.Normal)
{
MCNK = new MCNK(chunk);
Holes = MCNK.Flags.HasFlag(MCNK.MCNKFlags.HighResolutionHoles) ? HighResHoles : TransformToHighRes(MCNK.Holes);
stream.Seek(chunk.Offset + MCNK.ChunkHeaderSize, SeekOrigin.Begin);
SubData = new ChunkData(stream, chunk.Size - MCNK.ChunkHeaderSize);
}
else
SubData = new ChunkData(stream, chunk.Size);
Read();
}
示例3: ReadDoodadDefinitions
private void ReadDoodadDefinitions(Chunk c)
{
int count = (int)c.Length/36;
_definitions = new List<DoodadDefinition>(count);
var stream = c.GetStream();
for (int i = 0; i < count; i++)
{
var def = new DoodadDefinition();
def.Read(stream);
_definitions.Add(def);
}
}
示例4: ReadDoodadPaths
// TODO: this is so fucking idiotic because data and id share the same stream
private void ReadDoodadPaths(Chunk id, Chunk data)
{
int paths = (int)id.Length/4;
_paths = new List<string>(paths);
for (int i = 0; i < paths; i++)
{
var r = new BinaryReader(id.GetStream());
r.BaseStream.Seek(i*4, SeekOrigin.Current);
uint offset = r.ReadUInt32();
var dataStream = data.GetStream();
dataStream.Seek(offset + data.Offset, SeekOrigin.Begin);
_paths.Add(dataStream.ReadCString());
}
}