Skip to content

Instantly share code, notes, and snippets.

@jrusbatch
Created February 16, 2015 18:19
Show Gist options
  • Save jrusbatch/a12798fa0dbc90538ce5 to your computer and use it in GitHub Desktop.
Save jrusbatch/a12798fa0dbc90538ce5 to your computer and use it in GitHub Desktop.
public IEnumerable<T> ConquerFile<T>(Stream stream)
{
using (var reader = new PeekableTextReader(stream))
{
// find how big of an army we need
var conscriptInfo = _contextSurvey.AllOfTheLands<T>(reader);
// marshal the troops
var formation = _fileHelpersTypeDrafter.BuildPhalanx<T>(conscriptInfo);
// ATTACK!
var results = _fileSiegeMachine.Assault<T>(reader, formation);
foreach (var result in results)
{
yield return result;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment