protected override void LoadIndex(GameInfo game)
{
using (var file = ServiceLocator.FileStorage.OpenFileRead(game.Path))
{
var br = new BinaryReader(new XorStream(file, 0xFF));
var magic = br.ReadUInt16();
switch (magic)
{
case 0x0A31:
// Classic V1 game detected
ReadClassicIndexFile(br);
break;
case 0x0100:
// Enhanced V2 game detected
ReadEnhancedIndexFile(br);
break;
default:
throw new NotSupportedException(
string.Format("The magic id doesn't match ({0:X2})", magic));
}
}
}