Refactoring

This commit is contained in:
Anuken
2020-05-13 18:11:28 -04:00
parent e64122bbbb
commit 6e62936458
4 changed files with 8 additions and 8 deletions

View File

@@ -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()))))); app.post(() -> app.post(() -> app.post(() -> app.post(() -> super.resize(graphics.getWidth(), graphics.getHeight())))));
} }
}else{ }else{
asyncLogic.begin(); asyncCore.begin();
super.update(); super.update();
asyncLogic.end(); asyncCore.end();
} }
int targetfps = Core.settings.getInt("fpscap", 120); int targetfps = Core.settings.getInt("fpscap", 120);

View File

@@ -172,7 +172,7 @@ public class Vars implements Loadable{
public static Mods mods; public static Mods mods;
public static Schematics schematics; public static Schematics schematics;
public static BeControl becontrol; public static BeControl becontrol;
public static AsyncLogic asyncLogic; public static AsyncCore asyncCore;
public static TeamIndexProcess teamIndex; public static TeamIndexProcess teamIndex;
public static Universe universe; public static Universe universe;
@@ -241,7 +241,7 @@ public class Vars implements Loadable{
world = new World(); world = new World();
universe = new Universe(); universe = new Universe();
becontrol = new BeControl(); becontrol = new BeControl();
asyncLogic = new AsyncLogic(); asyncCore = new AsyncCore();
maps = new Maps(); maps = new Maps();
spawner = new WaveSpawner(); spawner = new WaveSpawner();

View File

@@ -9,7 +9,7 @@ import java.util.concurrent.*;
import static mindustry.Vars.state; import static mindustry.Vars.state;
public class AsyncLogic{ public class AsyncCore{
//all processes to be executed each frame //all processes to be executed each frame
private final Array<AsyncProcess> processes = Array.with( private final Array<AsyncProcess> processes = Array.with(
new PhysicsProcess(), new PhysicsProcess(),
@@ -26,7 +26,7 @@ public class AsyncLogic{
return thread; return thread;
}); });
public AsyncLogic(){ public AsyncCore(){
Events.on(WorldLoadEvent.class, e -> { Events.on(WorldLoadEvent.class, e -> {
complete(); complete();
for(AsyncProcess p : processes){ for(AsyncProcess p : processes){

View File

@@ -74,11 +74,11 @@ public class ServerLauncher implements ApplicationListener{
System.exit(1); 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(logic = new Logic());
Core.app.addListener(netServer = new NetServer()); Core.app.addListener(netServer = new NetServer());
Core.app.addListener(new ServerControl(args)); 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); mods.eachClass(Mod::init);