Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 645

[SOLVED] where Statement not working?

$
0
0
EDIT: SOLUTION
DO NOT USE SUB-GENERICS! These may work one minute and in the next stop working
But if you need a sub-geneirc for the as Statement use this
Code:
public void <T> foo()
    where T : class
{
[...]
}


ORIGINAL:
Hi,

I'm trying to make a function, that directly gives me a List<T> instead of the List<IMyFunctionalBlock>!

My first attempt:
Code:
public List<T> getAllBlocksOfType<T>()
where T : IMyTerminalBlock
{
    List<IMyTerminalBlock> b = new...
[SOLVED] where Statement not working?

Viewing all articles
Browse latest Browse all 645

Trending Articles