Mmd
Mmd
CC#
Created by Mmd on 8/8/2023 in #help
❔ giving current class type to a generic class
Hello the description seems to be not long as i need to write the whole thing so i'll describe the whole thing here. I have a class called Spell which is a generic class and only accepts a class with type of Legend. but now i have another class which is called TestLegend and is based on Legend. i also do have another class which is TestSpell and it generic type is TestLegend. So now i want to create a Spell array which can have any kind of Legend in itself. but heres the thing that i have to enter a type of Legend before creating an array due to the Spells' generic type and if i enter Spell<Legend>[] i cannot enter TestSpell because the array must only contain Spell with generic type of <Legend> what should i do?
9 replies