❔ How can i add to my List a Type from a Method without cast it to a other one
Hi i try to register my Renderer that should not get casted because it is a interface and i call it laiter in a foreach to run on every renderer the Draw Method, but how i see it not works because i would need it to cast to add it to this list has any a other idea to fix this?
5 Replies
oh i see right now thats not the problem
ok i have a list
i added every Registry to it
public static readonly List<IClientRegistry> Registries = new();
and i call all this methods with a foreach
and this method call a foreach again
does this make problems?
why does it not print in the foreach
it looks like foreach in a method is not allowed
that get called in a foreach
because it does not print in it
no
it does ignore it
even if i use a debugger
here it tell me everything
here like nothing happen
:/ ok
oh wait the list is empty
wait häää
why does it not work
the static thing never call register
why?
static things should get automaticly called when i create the class or not?
so why does it not call my method
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.