mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 19:39:04 +07:00
Refactoring
This commit is contained in:
parent
e64122bbbb
commit
6e62936458
@ -137,11 +137,11 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
app.post(() -> app.post(() -> app.post(() -> app.post(() -> super.resize(graphics.getWidth(), graphics.getHeight())))));
|
||||
}
|
||||
}else{
|
||||
asyncLogic.begin();
|
||||
asyncCore.begin();
|
||||
|
||||
super.update();
|
||||
|
||||
asyncLogic.end();
|
||||
asyncCore.end();
|
||||
}
|
||||
|
||||
int targetfps = Core.settings.getInt("fpscap", 120);
|
||||
|
@ -172,7 +172,7 @@ public class Vars implements Loadable{
|
||||
public static Mods mods;
|
||||
public static Schematics schematics;
|
||||
public static BeControl becontrol;
|
||||
public static AsyncLogic asyncLogic;
|
||||
public static AsyncCore asyncCore;
|
||||
public static TeamIndexProcess teamIndex;
|
||||
|
||||
public static Universe universe;
|
||||
@ -241,7 +241,7 @@ public class Vars implements Loadable{
|
||||
world = new World();
|
||||
universe = new Universe();
|
||||
becontrol = new BeControl();
|
||||
asyncLogic = new AsyncLogic();
|
||||
asyncCore = new AsyncCore();
|
||||
|
||||
maps = new Maps();
|
||||
spawner = new WaveSpawner();
|
||||
|
@ -9,7 +9,7 @@ import java.util.concurrent.*;
|
||||
|
||||
import static mindustry.Vars.state;
|
||||
|
||||
public class AsyncLogic{
|
||||
public class AsyncCore{
|
||||
//all processes to be executed each frame
|
||||
private final Array<AsyncProcess> processes = Array.with(
|
||||
new PhysicsProcess(),
|
||||
@ -26,7 +26,7 @@ public class AsyncLogic{
|
||||
return thread;
|
||||
});
|
||||
|
||||
public AsyncLogic(){
|
||||
public AsyncCore(){
|
||||
Events.on(WorldLoadEvent.class, e -> {
|
||||
complete();
|
||||
for(AsyncProcess p : processes){
|
@ -74,11 +74,11 @@ public class ServerLauncher implements ApplicationListener{
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
Core.app.addListener(new ApplicationListener(){public void update(){ asyncLogic.begin(); }});
|
||||
Core.app.addListener(new ApplicationListener(){public void update(){ asyncCore.begin(); }});
|
||||
Core.app.addListener(logic = new Logic());
|
||||
Core.app.addListener(netServer = new NetServer());
|
||||
Core.app.addListener(new ServerControl(args));
|
||||
Core.app.addListener(new ApplicationListener(){public void update(){ asyncLogic.end(); }});
|
||||
Core.app.addListener(new ApplicationListener(){public void update(){ asyncCore.end(); }});
|
||||
|
||||
mods.eachClass(Mod::init);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user