I have a method in a C # project that looks like
public T AddEC<T>() where T : EntityComponent, new() { if (!HasEC<T>()) { T nComponent = new T(); } }
Now I just recently started working correctly with Java Generics, but I have no idea how I could port such a method, or even if it is possible due to language restrictions, can anyone help?
source share