Sensor types

This commit is contained in:
Anuken
2020-08-08 18:01:54 -04:00
parent 4008d88f0b
commit da19c5ae19
16 changed files with 138 additions and 61 deletions

View File

@@ -16,6 +16,7 @@ import mindustry.entities.bullet.*;
import mindustry.entities.units.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.logic.*;
import mindustry.net.Administration.*;
import mindustry.net.Packets.*;
import mindustry.type.*;
@@ -85,6 +86,9 @@ public class TypeIO{
}else if(object instanceof Building){
write.b((byte)12);
write.i(((Building)object).pos());
}else if(object instanceof LSensor){
write.b((byte)13);
write.s(((LSensor)object).ordinal());
}else{
throw new IllegalArgumentException("Unknown object type: " + object.getClass());
}
@@ -107,6 +111,7 @@ public class TypeIO{
case 10: return read.bool();
case 11: return read.d();
case 12: return world.build(read.i());
case 13: return LSensor.all[read.s()];
default: throw new IllegalArgumentException("Unknown object type: " + type);
}
}