Task 2 – Wave generation
Using the same wave structure from Task 1, Steve wants to generate increasingly complex waves as the game progresses. Implement a recursive function, GenerateWave
, that creates a Wave
object with a nested structure of enemies and sub-waves based on the current level number.
public interface IWaveContent {} public class Enemy : IWaveContent { public string Name { get; set; } public EnemyType Type { get; set; } } public class Wave : IWaveContent { public List<IWaveContent> Contents { get; set; } = new(); } public enum EnemyType { Normal, Flying, Armored, Boss } // Implement this method Wave GenerateWave(int levelNumber) { // Your recursive logic here }
This function should create more complex wave structures...