Solutions
Here are the solutions to the exercises provided in the previous section. Use them to ensure your understanding and to correct any mistakes you might have made.
Solution 1
First, we compose these functions to create a transaction processing pipeline:
Func<IEnumerable<EnemyWave>, IEnumerable<string>> processEnemyWaves = waves => waves .Where(validateWave) .Select(applyHardMode) .Select(formatWave);
Then, we test it:
var enemyWaves = new List<EnemyWave> { new EnemyWave { WaveNumber = 1, EnemyCount = 50, Description = "Initial wave" }, new EnemyWave { WaveNumber = 2, EnemyCount = 0, Description = "Empty wave" }, new EnemyWave { WaveNumber...