I'm working on my own game engine and came to a wall that stopped me. When I'll be coding a game I will simply use my gameengine.jar as a library. But I want to reference some classes with a god-class "GameEngine".
In this example I will want to use a class "Logger" that simply logs errors. Both GameEngine and Logger don't have a constructor, they are static.
public class GameEngine{
public static Logger logger = Logger; // ERROR
}
class Logger{
static void logError(){
System.out.println("Error");
}
}
I want to do GameEngine.logger.logError(); but can't.
I could use a nested class but both classes are very long.