本文整理汇总了C#中GenericReader.ReadStruct方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadStruct方法的具体用法?C# GenericReader.ReadStruct怎么用?C# GenericReader.ReadStruct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadStruct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
void Init()
{
if (!File.Exists(WOW_EXE_NAME))
{
Console.WriteLine("{0} not found!", WOW_EXE_NAME);
Console.ReadKey();
return;
}
STREAM = new StreamReader(WOW_EXE_NAME, Encoding.ASCII).ReadToEnd();
gr = new GenericReader(WOW_EXE_NAME, Encoding.ASCII);
Console.WriteLine("{0} kb readed to filestream", gr.BaseStream.Length / 1024);
gr.BaseStream.Position = GO_DATA_INFO_START;
for (int i = 0; i < 128; ++i)
{
GameObjectDataNameInfo info = gr.ReadStruct<GameObjectDataNameInfo>();
m_GoDataNames.Add(info);
}
gr.BaseStream.Position = GO_TYPE_INFO_START;
for (int i = 0; i < 36; ++i)
{
GameObjectTypeInfo info = gr.ReadStruct<GameObjectTypeInfo>();
m_GoTypes.Add(info);
m_GoData.Add(new List<int>());
if (info.DataCount > 0)
{
long pos = gr.BaseStream.Position;
gr.BaseStream.Position = info.DataListOffset - OFFSET2;
for (int j = 0; j < info.DataCount; ++j)
{
int dataid = gr.ReadInt32();
m_GoData[i].Add(dataid);
}
gr.BaseStream.Position = pos;
}
}
DumpToFile();
gr.Close();
Console.WriteLine("Done!");
Console.ReadKey();
}