public int[] Level1Items(int floor)
{
switch (floor)
{
case 0:
case 1:
case 2:
case 3:
case 4: return CreateItems(0, 0, 0, 0, 0, 0);
case 5:
case 6: return CreateItems(1, 0, 0, 0, 0, 0);
case 7:
case 8:
case 9: return CreateItems(1, 1, 0, 0, 0, 0);
}
return generationItems;
}
Basically I have a level generation method where at certain levels the generation will change and ifferent items will appear. Levels 0-4 will have no additional spawning, level 5-6 will have 1 extra X and levels 7-9 will have 1X and 1Y etc..
So before I go and make cases 10 all the way through to 99 is there a better way I could be tackling this? Maybe with a series of ifs that just change the array at specific floors? Or is there something different entierly that I've not thought of.
Any ideas would be hugely appreciated :)
Edit 1: Thanks everyone for your input, really helped me solve my problem and thanks for all the quick responses too.
I decided to simply savemy int[] in my GameData and use the switch only to change it on the specific floors. Thanks again!