Answer the question
In order to leave comments, you need to log in
What does this constraint in the class header mean?
class Game< TFamilyType > : IGame where TFamilyType : IFamily, new()
{
//body
}
Answer the question
In order to leave comments, you need to log in
For this restriction to make sense, the Game class must be a generic class with a TFamilyType type parameter.
The constraint says that the type you substitute for TFamilyType when using the Game class must implement the IFamily interface and have a parameterless constructor.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question