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:
co-authored by
Anuken
parent
ea239c6f60
commit
9f92a5ac06
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user