Codegen for an inheritance tree
This commit is contained in:
@@ -43,7 +43,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
||||
//debug GL information
|
||||
Log.info("[GL] Version: @", graphics.getGLVersion());
|
||||
Log.info("[GL] Max texture size: @", Gl.getInt(Gl.maxTextureSize));
|
||||
Log.info("[GL] OpenGL 3.0 context: @", gl30 != null);
|
||||
Log.info("[GL] Using @ context.", gl30 != null ? "OpenGL 3" : "OpenGL 2");
|
||||
Log.info("[JAVA] Version: @", System.getProperty("java.version"));
|
||||
|
||||
Time.setDeltaProvider(() -> {
|
||||
|
||||
@@ -8,7 +8,7 @@ class GroupDefs<G>{
|
||||
@GroupDef(value = Playerc.class, mapping = true) G player;
|
||||
@GroupDef(value = Bulletc.class, spatial = true, collide = true) G bullet;
|
||||
@GroupDef(value = Unitc.class, spatial = true, mapping = true) G unit;
|
||||
@GroupDef(value = Tilec.class) G tile;
|
||||
@GroupDef(value = Buildingc.class) G tile;
|
||||
@GroupDef(value = Syncc.class, mapping = true) G sync;
|
||||
@GroupDef(value = Drawc.class) G draw;
|
||||
@GroupDef(value = Weatherc.class) G weather;
|
||||
|
||||
@@ -35,9 +35,9 @@ import mindustry.world.modules.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@EntityDef(value = {Tilec.class}, isFinal = false, genio = false, serialize = false)
|
||||
@Component
|
||||
abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTreeObject, Displayable{
|
||||
@EntityDef(value = {Buildingc.class}, isFinal = false, genio = false, serialize = false)
|
||||
@Component(base = true)
|
||||
abstract class BuildingComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTreeObject, Displayable{
|
||||
//region vars and initialization
|
||||
static final float timeToSleep = 60f * 1;
|
||||
static final ObjectSet<Tilec> tmpTiles = new ObjectSet<>();
|
||||
@@ -15,7 +15,7 @@ import mindustry.graphics.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@EntityDef(value = {Bulletc.class}, pooled = true, serialize = false)
|
||||
@Component
|
||||
@Component(base = true)
|
||||
abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Drawc, Shielderc, Ownerc, Velc, Bulletc, Timerc{
|
||||
@Import Team team;
|
||||
@Import Entityc owner;
|
||||
|
||||
@@ -27,7 +27,7 @@ import mindustry.world.blocks.storage.CoreBlock.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@EntityDef(value = {Playerc.class}, serialize = false)
|
||||
@Component
|
||||
@Component(base = true)
|
||||
abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Drawc{
|
||||
static final float deathDelay = 30f;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import mindustry.world.blocks.environment.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@Component
|
||||
@Component(base = true)
|
||||
abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, Itemsc, Rotc, Unitc, Weaponsc, Drawc, Boundedc, Syncc, Shieldc, Displayable{
|
||||
|
||||
@Import float x, y, rotation, elevation, maxHealth, drag, armor, hitSize, health;
|
||||
|
||||
@@ -69,7 +69,7 @@ public class Mods implements Loadable{
|
||||
|
||||
/** @return the loaded mod found by class, or null if not found. */
|
||||
public @Nullable LoadedMod getMod(Class<? extends Mod> type){
|
||||
return mods.find(m -> m.enabled() && m.main != null && m.main.getClass() == type);//loaded.find(l -> l.mod != null && l.mod.getClass() == type);
|
||||
return mods.find(m -> m.enabled() && m.main != null && m.main.getClass() == type);
|
||||
}
|
||||
|
||||
/** Imports an external mod file.*/
|
||||
|
||||
Reference in New Issue
Block a user