本文整理匯總了C#中Plasma.hsStream.Rewind方法的典型用法代碼示例。如果您正苦於以下問題:C# hsStream.Rewind方法的具體用法?C# hsStream.Rewind怎麽用?C# hsStream.Rewind使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plasma.hsStream
的用法示例。
在下文中一共展示了hsStream.Rewind方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Read
public void Read(hsStream s)
{
// Magically figure out what version we have...
uint prpVer = s.ReadUInt();
switch (prpVer) {
case 1:
case 2:
case 3:
case 4:
case 5:
s.Version = new plVersion(2, 0, 0, 0);
break;
case 6:
s.Version = plVersion.MystOnline;
break;
default:
// Must be some sort of Myst 5 variant...
s.Rewind();
prpVer = (uint)s.ReadUShort();
switch (prpVer) {
case 6:
s.Version = plVersion.EndOfAges;
break;
case 9:
s.Version = plVersion.HexIsle;
break;
default:
throw new plVersionException(prpVer);
}
break;
}
if (s.Version.IsPlasma21)
IReadClassVersions(s);
fLocation.Read(s);
fAge = s.ReadSafeString();
if (s.Version.IsPreMystOnline) fChapter = s.ReadSafeString();
else if (s.Version.IsMystOnline) fChapter = "District";
fPage = s.ReadSafeString();
// Some more versioning stuff for Uru...
if (s.Version.IsMystOnline)
s.Version = new plVersion(2, 0, s.ReadUShort(), 0);
else if (s.Version.IsPreMystOnline)
s.Version = new plVersion(2, 0, s.ReadUShort(), s.ReadUShort());
if (prpVer < 6) {
if (prpVer < 5) // IndexChecksum -- deprecated...
s.ReadUInt();
if (prpVer >= 2)
fReleaseVersion = s.ReadInt();
if (prpVer >= 3)
fFlags = (Flags)s.ReadInt();
}
if (prpVer >= 4)
fChecksum = s.ReadUInt();
if (prpVer >= 5) {
fDataStart = s.ReadUInt();
fIndexStart = s.ReadUInt();
} else {
//prm/prx???
fDataStart = 0;
fIndexStart = s.ReadByte();
}
// Garbage
if (s.Version.IsMystOnline)
IReadClassVersions(s);
}