Logic Refactor (#9940)

* Replace logic variable indexes

* Fix `draw print`'s align

* Update core/src/mindustry/logic/LExecutor.java

Co-authored-by: Anuken <arnukren@gmail.com>

* Remove duplicated variables

* Update core/src/mindustry/world/blocks/logic/LogicBlock.java

---------

Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
Redstonneur1256
2024-06-16 00:37:04 -04:00
committed by GitHub
co-authored by Anuken
parent ea239c6f60
commit 9f92a5ac06
9 changed files with 531 additions and 590 deletions
+8 -2
View File
@@ -1038,14 +1038,19 @@ public class TypeIO{
}
}
public interface Boxed<T> {
T unbox();
}
/** Represents a building that has not been resolved yet. */
public static class BuildingBox{
public static class BuildingBox implements Boxed<Building>{
public int pos;
public BuildingBox(int pos){
this.pos = pos;
}
@Override
public Building unbox(){
return world.build(pos);
}
@@ -1059,13 +1064,14 @@ public class TypeIO{
}
/** Represents a unit that has not been resolved yet. TODO unimplemented / unused*/
public static class UnitBox{
public static class UnitBox implements Boxed<Unit>{
public int id;
public UnitBox(int id){
this.id = id;
}
@Override
public Unit unbox(){
return Groups.unit.getByID(id);
}