Hi,
I wrote this method:
public IGamePlugin[,] GetTable<T>()
{
Type t = typeof(T);
if (t is IFixedElement)
{
return fixedElements;
}
else if (t is IFixedTile)
{
return fixedTiles;
}
else
{
throw new NotSupportedException("Type:" + t.ToString() + " is not supported");
}
}
And I'm quite unsure if it is not wrong usage of generics. I like it better than using a simple parameter (string or maybe Type) because the syntax is clear on the calling side.
What do you think?