Added the app state varargs constructor to LegacyApplication and
modified SimpleApplication to use it.
This commit is contained in:
parent
47b37a088f
commit
78a5a25fc1
@ -31,6 +31,7 @@
|
||||
*/
|
||||
package com.jme3.app;
|
||||
|
||||
import com.jme3.app.state.AppState;
|
||||
import com.jme3.app.state.AppStateManager;
|
||||
import com.jme3.asset.AssetManager;
|
||||
import com.jme3.audio.AudioContext;
|
||||
@ -100,8 +101,24 @@ public class LegacyApplication implements Application, SystemListener {
|
||||
/**
|
||||
* Create a new instance of <code>LegacyApplication</code>.
|
||||
*/
|
||||
public LegacyApplication(){
|
||||
public LegacyApplication() {
|
||||
this((AppState[])null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance of <code>LegacyApplication</code>, preinitialized
|
||||
* with the specified set of app states.
|
||||
*/
|
||||
public LegacyApplication( AppState... initialStates ) {
|
||||
initStateManager();
|
||||
|
||||
if (initialStates != null) {
|
||||
for (AppState a : initialStates) {
|
||||
if (a != null) {
|
||||
stateManager.attach(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,15 +100,7 @@ public abstract class SimpleApplication extends LegacyApplication {
|
||||
}
|
||||
|
||||
public SimpleApplication( AppState... initialStates ) {
|
||||
super();
|
||||
|
||||
if (initialStates != null) {
|
||||
for (AppState a : initialStates) {
|
||||
if (a != null) {
|
||||
stateManager.attach(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
super(initialStates);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user