public static GameState GetGameState(FileSystemEntry entry, Game game) { using (var stream = entry.Open()) { var reader = new StateReader(stream, game); while (true) { var chunkName = ""; reader.PersistAsciiString(ref chunkName); reader.BeginSegment(chunkName); if (chunkName == "CHUNK_GameState") { var gameState = new GameState(); gameState.Persist(reader); return(gameState); } reader.EndSegment(); } } throw new InvalidStateException(); }
public override void EndSegment() { _comparisonReader.EndSegment(); }