My constructor looks like this:
public MainApplet() {
super(new TitansArena(), false);
}
I want to be able to pass a reference of my MainApplet object to TitansArena constructor, how can I do that?
My constructor looks like this:
public MainApplet() {
super(new TitansArena(), false);
}
I want to be able to pass a reference of my MainApplet object to TitansArena constructor, how can I do that?
I've managed to find a way 'around' the problem like this:
public class MainApplet extends LwjglApplet {
private static final long serialVersionUID = 1L;
TitansArena game;
public MainApplet() {
this(new TitansArena());
}
private MainApplet(TitansArena ta) {
super(ta, false);
game = ta;
game.ap = this;
}
}
Where ap
is declared like this: public Applet ap;
in TitansArena
.