Merge branch 'master' of https://github.com/Anuken/Mindustry into v105

This commit is contained in:
Petr Gašparík
2020-06-22 22:54:57 +02:00
489 changed files with 24235 additions and 5577 deletions

View File

@@ -3,15 +3,26 @@ name: Java CI
on: [push] on: [push]
jobs: jobs:
build: buildJava8:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Set up JDK 1.8 - name: Set up JDK 8
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: 8
#- name: Run unit tests with gradle - name: Run unit tests with gradle and Java 8
# run: ./gradlew test run: ./gradlew test
buildJava14:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Run unit tests with gradle and Java 14
run: ./gradlew test

View File

@@ -20,6 +20,12 @@ script:
- "./gradlew test" - "./gradlew test"
- "./gradlew desktop:dist -Pbuildversion=${TRAVIS_TAG:1}" - "./gradlew desktop:dist -Pbuildversion=${TRAVIS_TAG:1}"
- "./gradlew server:dist -Pbuildversion=${TRAVIS_TAG:1}" - "./gradlew server:dist -Pbuildversion=${TRAVIS_TAG:1}"
- "./gradlew core:javadoc"
- cd ../
- git clone --depth=1 https://github.com/MindustryGame/docs.git
- cp -a Mindustry/core/build/docs/javadoc/. docs/
- cd docs
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git add .; git commit -m "Update ${TRAVIS_BUILD_NUMBER}"; git push https://Anuken:${GH_PUSH_TOKEN}@github.com/MindustryGame/docs; fi
deploy: deploy:
- provider: releases - provider: releases
skip_cleanup: true skip_cleanup: true

View File

@@ -7,6 +7,7 @@ A sandbox tower defense game written in Java.
_[Trello Board](https://trello.com/b/aE2tcUwF/mindustry-40-plans)_ _[Trello Board](https://trello.com/b/aE2tcUwF/mindustry-40-plans)_
_[Wiki](https://mindustrygame.github.io/wiki)_ _[Wiki](https://mindustrygame.github.io/wiki)_
_[Javadoc](https://mindustrygame.github.io/docs/)_
### Contributing ### Contributing

View File

@@ -69,7 +69,7 @@ public class AndroidLauncher extends AndroidApplication{
} }
@Override @Override
public org.mozilla.javascript.Context getScriptContext(){ public rhino.Context getScriptContext(){
return AndroidRhinoContext.enter(getContext().getCacheDir()); return AndroidRhinoContext.enter(getContext().getCacheDir());
} }

View File

@@ -13,7 +13,7 @@ import com.android.dx.dex.cf.*;
import com.android.dx.dex.file.DexFile; import com.android.dx.dex.file.DexFile;
import com.android.dx.merge.*; import com.android.dx.merge.*;
import dalvik.system.*; import dalvik.system.*;
import org.mozilla.javascript.*; import rhino.*;
import java.io.*; import java.io.*;
import java.nio.*; import java.nio.*;

View File

@@ -1,3 +1,2 @@
sourceCompatibility = 1.8
sourceSets.main.java.srcDirs = ["src/main/java/"] sourceSets.main.java.srcDirs = ["src/main/java/"]
sourceSets.main.resources.srcDirs = ["src/main/resources/"] sourceSets.main.resources.srcDirs = ["src/main/resources/"]

View File

@@ -1,7 +1,7 @@
package mindustry.annotations; package mindustry.annotations;
import arc.files.*; import arc.files.*;
import arc.struct.Array; import arc.struct.*;
import arc.util.*; import arc.util.*;
import arc.util.Log; import arc.util.Log;
import arc.util.Log.*; import arc.util.Log.*;
@@ -126,12 +126,12 @@ public abstract class BaseProcessor extends AbstractProcessor{
write(builder, null); write(builder, null);
} }
public static void write(TypeSpec.Builder builder, Array<String> imports) throws Exception{ public static void write(TypeSpec.Builder builder, Seq<String> imports) throws Exception{
JavaFile file = JavaFile.builder(packageName, builder.build()).skipJavaLangImports(true).build(); JavaFile file = JavaFile.builder(packageName, builder.build()).skipJavaLangImports(true).build();
if(imports != null){ if(imports != null){
String rawSource = file.toString(); String rawSource = file.toString();
Array<String> result = new Array<>(); Seq<String> result = new Seq<>();
for (String s : rawSource.split("\n", -1)) { for (String s : rawSource.split("\n", -1)) {
result.add(s); result.add(s);
if (s.startsWith("package ")) { if (s.startsWith("package ")) {
@@ -152,22 +152,22 @@ public abstract class BaseProcessor extends AbstractProcessor{
} }
} }
public Array<Selement> elements(Class<? extends Annotation> type){ public Seq<Selement> elements(Class<? extends Annotation> type){
return Array.with(env.getElementsAnnotatedWith(type)).map(Selement::new); return Seq.with(env.getElementsAnnotatedWith(type)).map(Selement::new);
} }
public Array<Stype> types(Class<? extends Annotation> type){ public Seq<Stype> types(Class<? extends Annotation> type){
return Array.with(env.getElementsAnnotatedWith(type)).select(e -> e instanceof TypeElement) return Seq.with(env.getElementsAnnotatedWith(type)).select(e -> e instanceof TypeElement)
.map(e -> new Stype((TypeElement)e)); .map(e -> new Stype((TypeElement)e));
} }
public Array<Svar> fields(Class<? extends Annotation> type){ public Seq<Svar> fields(Class<? extends Annotation> type){
return Array.with(env.getElementsAnnotatedWith(type)).select(e -> e instanceof VariableElement) return Seq.with(env.getElementsAnnotatedWith(type)).select(e -> e instanceof VariableElement)
.map(e -> new Svar((VariableElement)e)); .map(e -> new Svar((VariableElement)e));
} }
public Array<Smethod> methods(Class<? extends Annotation> type){ public Seq<Smethod> methods(Class<? extends Annotation> type){
return Array.with(env.getElementsAnnotatedWith(type)).select(e -> e instanceof ExecutableElement) return Seq.with(env.getElementsAnnotatedWith(type)).select(e -> e instanceof ExecutableElement)
.map(e -> new Smethod((ExecutableElement)e)); .map(e -> new Smethod((ExecutableElement)e));
} }

View File

@@ -19,12 +19,14 @@ public class EntityIO{
final static Json json = new Json(); final static Json json = new Json();
//suffixes for sync fields //suffixes for sync fields
final static String targetSuf = "_TARGET_", lastSuf = "_LAST_"; final static String targetSuf = "_TARGET_", lastSuf = "_LAST_";
//replacements after refactoring
final static StringMap replacements = StringMap.of("mindustry.entities.units.BuildRequest", "mindustry.entities.units.BuildPlan");
final ClassSerializer serializer; final ClassSerializer serializer;
final String name; final String name;
final TypeSpec.Builder type; final TypeSpec.Builder type;
final Fi directory; final Fi directory;
final Array<Revision> revisions = new Array<>(); final Seq<Revision> revisions = new Seq<>();
boolean write; boolean write;
MethodSpec.Builder method; MethodSpec.Builder method;
@@ -47,7 +49,7 @@ public class EntityIO{
int nextRevision = revisions.isEmpty() ? 0 : revisions.max(r -> r.version).version + 1; int nextRevision = revisions.isEmpty() ? 0 : revisions.max(r -> r.version).version + 1;
//resolve preferred field order based on fields that fit //resolve preferred field order based on fields that fit
Array<FieldSpec> fields = Array.with(type.fieldSpecs).select(spec -> Seq<FieldSpec> fields = Seq.with(type.fieldSpecs).select(spec ->
!spec.hasModifier(Modifier.TRANSIENT) && !spec.hasModifier(Modifier.TRANSIENT) &&
!spec.hasModifier(Modifier.STATIC) && !spec.hasModifier(Modifier.STATIC) &&
!spec.hasModifier(Modifier.FINAL)/* && !spec.hasModifier(Modifier.FINAL)/* &&
@@ -110,7 +112,7 @@ public class EntityIO{
} }
} }
void writeSync(MethodSpec.Builder method, boolean write, Array<Svar> syncFields, Array<Svar> allFields) throws Exception{ void writeSync(MethodSpec.Builder method, boolean write, Seq<Svar> syncFields, Seq<Svar> allFields) throws Exception{
this.method = method; this.method = method;
this.write = write; this.write = write;
@@ -147,7 +149,7 @@ public class EntityIO{
} }
} }
void writeSyncManual(MethodSpec.Builder method, boolean write, Array<Svar> syncFields) throws Exception{ void writeSyncManual(MethodSpec.Builder method, boolean write, Seq<Svar> syncFields) throws Exception{
this.method = method; this.method = method;
this.write = write; this.write = write;
@@ -170,7 +172,7 @@ public class EntityIO{
} }
} }
void writeInterpolate(MethodSpec.Builder method, Array<Svar> fields) throws Exception{ void writeInterpolate(MethodSpec.Builder method, Seq<Svar> fields) throws Exception{
this.method = method; this.method = method;
cont("if(lastUpdated != 0 && updateSpacing != 0)"); cont("if(lastUpdated != 0 && updateSpacing != 0)");
@@ -197,6 +199,9 @@ public class EntityIO{
} }
private void io(String type, String field) throws Exception{ private void io(String type, String field) throws Exception{
type = type.replace("mindustry.gen.", "");
type = replacements.get(type, type);
if(BaseProcessor.isPrimitive(type)){ if(BaseProcessor.isPrimitive(type)){
s(type.equals("boolean") ? "bool" : type.charAt(0) + "", field); s(type.equals("boolean") ? "bool" : type.charAt(0) + "", field);
}else if(instanceOf(type, "mindustry.ctype.Content")){ }else if(instanceOf(type, "mindustry.ctype.Content")){
@@ -234,7 +239,7 @@ public class EntityIO{
String struct = type.substring(0, type.indexOf("<")); String struct = type.substring(0, type.indexOf("<"));
String generic = type.substring(type.indexOf("<") + 1, type.indexOf(">")); String generic = type.substring(type.indexOf("<") + 1, type.indexOf(">"));
if(struct.equals("arc.struct.Queue") || struct.equals("arc.struct.Array")){ if(struct.equals("arc.struct.Queue") || struct.equals("arc.struct.Seq")){
if(write){ if(write){
s("i", field + ".size"); s("i", field + ".size");
cont("for(int INDEX = 0; INDEX < $L.size; INDEX ++)", field); cont("for(int INDEX = 0; INDEX < $L.size; INDEX ++)", field);
@@ -289,9 +294,9 @@ public class EntityIO{
public static class Revision{ public static class Revision{
int version; int version;
Array<RevisionField> fields; Seq<RevisionField> fields;
Revision(int version, Array<RevisionField> fields){ Revision(int version, Seq<RevisionField> fields){
this.version = version; this.version = version;
this.fields = fields; this.fields = fields;
} }
@@ -299,7 +304,7 @@ public class EntityIO{
Revision(){} Revision(){}
/** @return whether these two revisions are compatible */ /** @return whether these two revisions are compatible */
boolean equal(Array<FieldSpec> specs){ boolean equal(Seq<FieldSpec> specs){
if(fields.size != specs.size) return false; if(fields.size != specs.size) return false;
for(int i = 0; i < fields.size; i++){ for(int i = 0; i < fields.size; i++){

View File

@@ -30,18 +30,18 @@ import java.lang.annotation.*;
"mindustry.annotations.Annotations.TypeIOHandler" "mindustry.annotations.Annotations.TypeIOHandler"
}) })
public class EntityProcess extends BaseProcessor{ public class EntityProcess extends BaseProcessor{
Array<EntityDefinition> definitions = new Array<>(); Seq<EntityDefinition> definitions = new Seq<>();
Array<GroupDefinition> groupDefs = new Array<>(); Seq<GroupDefinition> groupDefs = new Seq<>();
Array<Stype> baseComponents; Seq<Stype> baseComponents;
ObjectMap<String, Stype> componentNames = new ObjectMap<>(); ObjectMap<String, Stype> componentNames = new ObjectMap<>();
ObjectMap<Stype, Array<Stype>> componentDependencies = new ObjectMap<>(); ObjectMap<Stype, Seq<Stype>> componentDependencies = new ObjectMap<>();
ObjectMap<Selement, Array<Stype>> defComponents = new ObjectMap<>(); ObjectMap<Selement, Seq<Stype>> defComponents = new ObjectMap<>();
ObjectMap<Svar, String> varInitializers = new ObjectMap<>(); ObjectMap<String, String> varInitializers = new ObjectMap<>();
ObjectMap<Smethod, String> methodBlocks = new ObjectMap<>(); ObjectMap<String, String> methodBlocks = new ObjectMap<>();
ObjectSet<String> imports = new ObjectSet<>(); ObjectSet<String> imports = new ObjectSet<>();
Array<Selement> allGroups = new Array<>(); Seq<Selement> allGroups = new Seq<>();
Array<Selement> allDefs = new Array<>(); Seq<Selement> allDefs = new Seq<>();
Array<Stype> allInterfaces = new Array<>(); Seq<Stype> allInterfaces = new Seq<>();
ClassSerializer serializer; ClassSerializer serializer;
{ {
@@ -58,7 +58,7 @@ public class EntityProcess extends BaseProcessor{
if(round == 1){ if(round == 1){
serializer = TypeIOResolver.resolve(this); serializer = TypeIOResolver.resolve(this);
baseComponents = types(BaseComponent.class); baseComponents = types(BaseComponent.class);
Array<Stype> allComponents = types(Component.class); Seq<Stype> allComponents = types(Component.class);
//store code //store code
for(Stype component : allComponents){ for(Stype component : allComponents){
@@ -68,14 +68,14 @@ public class EntityProcess extends BaseProcessor{
//add initializer if it exists //add initializer if it exists
if(tree.getInitializer() != null){ if(tree.getInitializer() != null){
String init = tree.getInitializer().toString(); String init = tree.getInitializer().toString();
varInitializers.put(f, init); varInitializers.put(f.descString(), init);
} }
} }
for(Smethod elem : component.methods()){ for(Smethod elem : component.methods()){
if(elem.is(Modifier.ABSTRACT) || elem.is(Modifier.NATIVE)) continue; if(elem.is(Modifier.ABSTRACT) || elem.is(Modifier.NATIVE)) continue;
//get all statements in the method, store them //get all statements in the method, store them
methodBlocks.put(elem, elem.tree().getBody().toString()); methodBlocks.put(elem.descString(), elem.tree().getBody().toString());
} }
} }
@@ -103,7 +103,7 @@ public class EntityProcess extends BaseProcessor{
} }
//implement super interfaces //implement super interfaces
Array<Stype> depends = getDependencies(component); Seq<Stype> depends = getDependencies(component);
for(Stype type : depends){ for(Stype type : depends){
inter.addSuperinterface(ClassName.get(packageName, interfaceName(type))); inter.addSuperinterface(ClassName.get(packageName, interfaceName(type)));
} }
@@ -133,7 +133,7 @@ public class EntityProcess extends BaseProcessor{
//getter //getter
if(!signatures.contains(cname + "()")){ if(!signatures.contains(cname + "()")){
inter.addMethod(MethodSpec.methodBuilder(cname).addModifiers(Modifier.ABSTRACT, Modifier.PUBLIC) inter.addMethod(MethodSpec.methodBuilder(cname).addModifiers(Modifier.ABSTRACT, Modifier.PUBLIC)
.addAnnotations(Array.with(field.annotations()).select(a -> a.toString().contains("Null")).map(AnnotationSpec::get)) .addAnnotations(Seq.with(field.annotations()).select(a -> a.toString().contains("Null")).map(AnnotationSpec::get))
.addJavadoc(field.doc() == null ? "" : field.doc()) .addJavadoc(field.doc() == null ? "" : field.doc())
.returns(field.tname()).build()); .returns(field.tname()).build());
} }
@@ -144,7 +144,7 @@ public class EntityProcess extends BaseProcessor{
inter.addMethod(MethodSpec.methodBuilder(cname).addModifiers(Modifier.ABSTRACT, Modifier.PUBLIC) inter.addMethod(MethodSpec.methodBuilder(cname).addModifiers(Modifier.ABSTRACT, Modifier.PUBLIC)
.addJavadoc(field.doc() == null ? "" : field.doc()) .addJavadoc(field.doc() == null ? "" : field.doc())
.addParameter(ParameterSpec.builder(field.tname(), field.name()) .addParameter(ParameterSpec.builder(field.tname(), field.name())
.addAnnotations(Array.with(field.annotations()) .addAnnotations(Seq.with(field.annotations())
.select(a -> a.toString().contains("Null")).map(AnnotationSpec::get)).build()).build()); .select(a -> a.toString().contains("Null")).map(AnnotationSpec::get)).build()).build());
} }
} }
@@ -161,7 +161,7 @@ public class EntityProcess extends BaseProcessor{
//log methods generated //log methods generated
for(MethodSpec spec : inter.methodSpecs){ for(MethodSpec spec : inter.methodSpecs){
Log.debug("&g> > &c@ @(@)", simpleName(spec.returnType.toString()), spec.name, Array.with(spec.parameters).toString(", ", p -> simpleName(p.type.toString()) + " " + p.name)); Log.debug("&g> > &c@ @(@)", simpleName(spec.returnType.toString()), spec.name, Seq.with(spec.parameters).toString(", ", p -> simpleName(p.type.toString()) + " " + p.name));
} }
Log.debug(""); Log.debug("");
@@ -170,9 +170,10 @@ public class EntityProcess extends BaseProcessor{
}else if(round == 2){ //round 2: get component classes and generate interfaces for them }else if(round == 2){ //round 2: get component classes and generate interfaces for them
//parse groups //parse groups
//this needs to be done before the entity interfaces are generated, as the entity classes need to know which groups to add themselves to
for(Selement<?> group : allGroups){ for(Selement<?> group : allGroups){
GroupDef an = group.annotation(GroupDef.class); GroupDef an = group.annotation(GroupDef.class);
Array<Stype> types = types(an, GroupDef::value).map(this::interfaceToComp); Seq<Stype> types = types(an, GroupDef::value).map(this::interfaceToComp);
boolean collides = an.collide(); boolean collides = an.collide();
groupDefs.add(new GroupDefinition(group.name().startsWith("g") ? group.name().substring(1) : group.name(), groupDefs.add(new GroupDefinition(group.name().startsWith("g") ? group.name().substring(1) : group.name(),
ClassName.bestGuess(packageName + "." + interfaceName(types.first())), types, an.spatial(), an.mapping(), collides)); ClassName.bestGuess(packageName + "." + interfaceName(types.first())), types, an.spatial(), an.mapping(), collides));
@@ -183,6 +184,7 @@ public class EntityProcess extends BaseProcessor{
//look at each definition //look at each definition
for(Selement<?> type : allDefs){ for(Selement<?> type : allDefs){
EntityDef ann = type.annotation(EntityDef.class); EntityDef ann = type.annotation(EntityDef.class);
boolean isFinal = ann.isFinal(); boolean isFinal = ann.isFinal();
@@ -209,9 +211,9 @@ public class EntityProcess extends BaseProcessor{
TypeSpec.Builder builder = TypeSpec.classBuilder(name).addModifiers(Modifier.PUBLIC); TypeSpec.Builder builder = TypeSpec.classBuilder(name).addModifiers(Modifier.PUBLIC);
if(isFinal) builder.addModifiers(Modifier.FINAL); if(isFinal) builder.addModifiers(Modifier.FINAL);
Array<Stype> components = allComponents(type); Seq<Stype> components = allComponents(type);
Array<GroupDefinition> groups = groupDefs.select(g -> (!g.components.isEmpty() && !g.components.contains(s -> !components.contains(s))) || g.manualInclusions.contains(type)); Seq<GroupDefinition> groups = groupDefs.select(g -> (!g.components.isEmpty() && !g.components.contains(s -> !components.contains(s))) || g.manualInclusions.contains(type));
ObjectMap<String, Array<Smethod>> methods = new ObjectMap<>(); ObjectMap<String, Seq<Smethod>> methods = new ObjectMap<>();
ObjectMap<FieldSpec, Svar> specVariables = new ObjectMap<>(); ObjectMap<FieldSpec, Svar> specVariables = new ObjectMap<>();
ObjectSet<String> usedFields = new ObjectSet<>(); ObjectSet<String> usedFields = new ObjectSet<>();
@@ -219,8 +221,8 @@ public class EntityProcess extends BaseProcessor{
builder.addMethod(MethodSpec.methodBuilder("serialize").addModifiers(Modifier.PUBLIC, Modifier.FINAL).returns(boolean.class).addStatement("return " + ann.serialize()).build()); builder.addMethod(MethodSpec.methodBuilder("serialize").addModifiers(Modifier.PUBLIC, Modifier.FINAL).returns(boolean.class).addStatement("return " + ann.serialize()).build());
//all SyncField fields //all SyncField fields
Array<Svar> syncedFields = new Array<>(); Seq<Svar> syncedFields = new Seq<>();
Array<Svar> allFields = new Array<>(); Seq<Svar> allFields = new Seq<>();
boolean isSync = components.contains(s -> s.name().contains("Sync")); boolean isSync = components.contains(s -> s.name().contains("Sync"));
@@ -228,7 +230,7 @@ public class EntityProcess extends BaseProcessor{
for(Stype comp : components){ for(Stype comp : components){
//write fields to the class; ignoring transient/imported ones //write fields to the class; ignoring transient/imported ones
Array<Svar> fields = comp.fields().select(f -> !f.has(Import.class)); Seq<Svar> fields = comp.fields().select(f -> !f.has(Import.class));
for(Svar f : fields){ for(Svar f : fields){
if(!usedFields.add(f.name())){ if(!usedFields.add(f.name())){
err("Field '" + f.name() + "' of component '" + comp.name() + "' re-defines a field in entity '" + type.name() + "'"); err("Field '" + f.name() + "' of component '" + comp.name() + "' re-defines a field in entity '" + type.name() + "'");
@@ -247,8 +249,8 @@ public class EntityProcess extends BaseProcessor{
} }
//add initializer if it exists //add initializer if it exists
if(varInitializers.containsKey(f)){ if(varInitializers.containsKey(f.descString())){
fbuilder.initializer(varInitializers.get(f)); fbuilder.initializer(varInitializers.get(f.descString()));
} }
fbuilder.addModifiers(f.has(ReadOnly.class) ? Modifier.PROTECTED : Modifier.PUBLIC); fbuilder.addModifiers(f.has(ReadOnly.class) ? Modifier.PROTECTED : Modifier.PUBLIC);
@@ -277,9 +279,9 @@ public class EntityProcess extends BaseProcessor{
} }
} }
//get all utility methods from components //get all methods from components
for(Smethod elem : comp.methods()){ for(Smethod elem : comp.methods()){
methods.get(elem.toString(), Array::new).add(elem); methods.get(elem.toString(), Seq::new).add(elem);
} }
} }
@@ -297,7 +299,7 @@ public class EntityProcess extends BaseProcessor{
boolean hasIO = ann.genio() && (components.contains(s -> s.name().contains("Sync")) || ann.serialize()); boolean hasIO = ann.genio() && (components.contains(s -> s.name().contains("Sync")) || ann.serialize());
//add all methods from components //add all methods from components
for(ObjectMap.Entry<String, Array<Smethod>> entry : methods){ for(ObjectMap.Entry<String, Seq<Smethod>> entry : methods){
if(entry.value.contains(m -> m.has(Replace.class))){ if(entry.value.contains(m -> m.has(Replace.class))){
//check replacements //check replacements
if(entry.value.count(m -> m.has(Replace.class)) > 1){ if(entry.value.count(m -> m.has(Replace.class)) > 1){
@@ -388,10 +390,12 @@ public class EntityProcess extends BaseProcessor{
} }
for(Smethod elem : entry.value){ for(Smethod elem : entry.value){
if(elem.is(Modifier.ABSTRACT) || elem.is(Modifier.NATIVE) || !methodBlocks.containsKey(elem)) continue; String descStr = elem.descString();
if(elem.is(Modifier.ABSTRACT) || elem.is(Modifier.NATIVE) || !methodBlocks.containsKey(descStr)) continue;
//get all statements in the method, copy them over //get all statements in the method, copy them over
String str = methodBlocks.get(elem); String str = methodBlocks.get(descStr);
//name for code blocks in the methods //name for code blocks in the methods
String blockName = elem.up().getSimpleName().toString().toLowerCase().replace("comp", ""); String blockName = elem.up().getSimpleName().toString().toLowerCase().replace("comp", "");
@@ -434,13 +438,14 @@ public class EntityProcess extends BaseProcessor{
for(FieldSpec spec : builder.fieldSpecs){ for(FieldSpec spec : builder.fieldSpecs){
@Nullable Svar variable = specVariables.get(spec); @Nullable Svar variable = specVariables.get(spec);
if(variable != null && variable.isAny(Modifier.STATIC, Modifier.FINAL)) continue; if(variable != null && variable.isAny(Modifier.STATIC, Modifier.FINAL)) continue;
String desc = variable.descString();
if(spec.type.isPrimitive()){ if(spec.type.isPrimitive()){
//set to primitive default //set to primitive default
resetBuilder.addStatement("$L = $L", spec.name, variable != null && varInitializers.containsKey(variable) ? varInitializers.get(variable) : getDefault(spec.type.toString())); resetBuilder.addStatement("$L = $L", spec.name, variable != null && varInitializers.containsKey(desc) ? varInitializers.get(desc) : getDefault(spec.type.toString()));
}else{ }else{
//set to default null //set to default null
if(!varInitializers.containsKey(variable)){ if(!varInitializers.containsKey(desc)){
resetBuilder.addStatement("$L = null", spec.name); resetBuilder.addStatement("$L = null", spec.name);
} //else... TODO reset if poolable } //else... TODO reset if poolable
} }
@@ -513,7 +518,7 @@ public class EntityProcess extends BaseProcessor{
if(!idProps.exists()) idProps.writeString(""); if(!idProps.exists()) idProps.writeString("");
PropertiesUtils.load(map, idProps.reader()); PropertiesUtils.load(map, idProps.reader());
//next ID to be used in generation //next ID to be used in generation
Integer max = map.values().toArray().map(Integer::parseInt).max(i -> i); Integer max = map.values().toSeq().map(Integer::parseInt).max(i -> i);
int maxID = max == null ? 0 : max + 1; int maxID = max == null ? 0 : max + 1;
//assign IDs //assign IDs
@@ -591,7 +596,7 @@ public class EntityProcess extends BaseProcessor{
//generate getter/setter for each method //generate getter/setter for each method
for(Smethod method : inter.methods()){ for(Smethod method : inter.methods()){
String var = method.name(); String var = method.name();
FieldSpec field = Array.with(def.builder.fieldSpecs).find(f -> f.name.equals(var)); FieldSpec field = Seq.with(def.builder.fieldSpecs).find(f -> f.name.equals(var));
//make sure it's a real variable AND that the component doesn't already implement it somewhere with custom logic //make sure it's a real variable AND that the component doesn't already implement it somewhere with custom logic
if(field == null || methodNames.contains(method.simpleString())) continue; if(field == null || methodNames.contains(method.simpleString())) continue;
@@ -601,7 +606,7 @@ public class EntityProcess extends BaseProcessor{
} }
//setter //setter
if(method.isVoid() && !Array.with(field.annotations).contains(f -> f.type.toString().equals("@mindustry.annotations.Annotations.ReadOnly"))){ if(method.isVoid() && !Seq.with(field.annotations).contains(f -> f.type.toString().equals("@mindustry.annotations.Annotations.ReadOnly"))){
def.builder.addMethod(MethodSpec.overriding(method.e).addModifiers(Modifier.FINAL).addStatement("this." + var + " = " + var).build()); def.builder.addMethod(MethodSpec.overriding(method.e).addModifiers(Modifier.FINAL).addStatement("this." + var + " = " + var).build());
} }
} }
@@ -616,8 +621,8 @@ public class EntityProcess extends BaseProcessor{
//create mock types of all components //create mock types of all components
for(Stype interf : allInterfaces){ for(Stype interf : allInterfaces){
//indirect interfaces to implement methods for //indirect interfaces to implement methods for
Array<Stype> dependencies = interf.allInterfaces().and(interf); Seq<Stype> dependencies = interf.allInterfaces().and(interf);
Array<Smethod> methods = dependencies.flatMap(Stype::methods); Seq<Smethod> methods = dependencies.flatMap(Stype::methods);
methods.sortComparing(Object::toString); methods.sortComparing(Object::toString);
//used method signatures //used method signatures
@@ -645,10 +650,11 @@ public class EntityProcess extends BaseProcessor{
builder.addStatement("return -1"); builder.addStatement("return -1");
}else{ }else{
Svar variable = compType == null || method.params().size > 0 ? null : compType.fields().find(v -> v.name().equals(method.name())); Svar variable = compType == null || method.params().size > 0 ? null : compType.fields().find(v -> v.name().equals(method.name()));
if(variable == null || !varInitializers.containsKey(variable)){ String desc = variable == null ? null : variable.descString();
if(variable == null || !varInitializers.containsKey(desc)){
builder.addStatement("return " + getDefault(method.ret().toString())); builder.addStatement("return " + getDefault(method.ret().toString()));
}else{ }else{
String init = varInitializers.get(variable); String init = varInitializers.get(desc);
builder.addStatement("return " + (init.equals("{}") ? "new " + variable.mirror().toString() : "") + init); builder.addStatement("return " + (init.equals("{}") ? "new " + variable.mirror().toString() : "") + init);
} }
} }
@@ -668,8 +674,8 @@ public class EntityProcess extends BaseProcessor{
} }
} }
Array<String> getImports(Element elem){ Seq<String> getImports(Element elem){
return Array.with(trees.getPath(elem).getCompilationUnit().getImports()).map(Object::toString); return Seq.with(trees.getPath(elem).getCompilationUnit().getImports()).map(Object::toString);
} }
/** @return interface for a component type */ /** @return interface for a component type */
@@ -682,11 +688,11 @@ public class EntityProcess extends BaseProcessor{
} }
/** @return all components that a entity def has */ /** @return all components that a entity def has */
Array<Stype> allComponents(Selement<?> type){ Seq<Stype> allComponents(Selement<?> type){
if(!defComponents.containsKey(type)){ if(!defComponents.containsKey(type)){
//get base defs //get base defs
Array<Stype> interfaces = types(type.annotation(EntityDef.class), EntityDef::value); Seq<Stype> interfaces = types(type.annotation(EntityDef.class), EntityDef::value);
Array<Stype> components = new Array<>(); Seq<Stype> components = new Seq<>();
for(Stype i : interfaces){ for(Stype i : interfaces){
Stype comp = interfaceToComp(i); Stype comp = interfaceToComp(i);
if(comp != null){ if(comp != null){
@@ -709,7 +715,7 @@ public class EntityProcess extends BaseProcessor{
return defComponents.get(type); return defComponents.get(type);
} }
Array<Stype> getDependencies(Stype component){ Seq<Stype> getDependencies(Stype component){
if(!componentDependencies.containsKey(component)){ if(!componentDependencies.containsKey(component)){
ObjectSet<Stype> out = new ObjectSet<>(); ObjectSet<Stype> out = new ObjectSet<>();
//add base component interfaces //add base component interfaces
@@ -746,7 +752,7 @@ public class EntityProcess extends BaseProcessor{
} }
String createName(Selement<?> elem){ String createName(Selement<?> elem){
Array<Stype> comps = types(elem.annotation(EntityDef.class), EntityDef::value).map(this::interfaceToComp);; Seq<Stype> comps = types(elem.annotation(EntityDef.class), EntityDef::value).map(this::interfaceToComp);;
comps.sortComparing(Selement::name); comps.sortComparing(Selement::name);
return comps.toString("", s -> s.name().replace("Comp", "")) + "Entity"; return comps.toString("", s -> s.name().replace("Comp", "")) + "Entity";
} }
@@ -755,11 +761,11 @@ public class EntityProcess extends BaseProcessor{
return type.annotation(Component.class) != null; return type.annotation(Component.class) != null;
} }
<T extends Annotation> Array<Stype> types(T t, Cons<T> consumer){ <T extends Annotation> Seq<Stype> types(T t, Cons<T> consumer){
try{ try{
consumer.get(t); consumer.get(t);
}catch(MirroredTypesException e){ }catch(MirroredTypesException e){
return Array.with(e.getTypeMirrors()).map(Stype::of); return Seq.with(e.getTypeMirrors()).map(Stype::of);
} }
throw new IllegalArgumentException("Missing types."); throw new IllegalArgumentException("Missing types.");
} }
@@ -767,11 +773,11 @@ public class EntityProcess extends BaseProcessor{
class GroupDefinition{ class GroupDefinition{
final String name; final String name;
final ClassName baseType; final ClassName baseType;
final Array<Stype> components; final Seq<Stype> components;
final boolean spatial, mapping, collides; final boolean spatial, mapping, collides;
final ObjectSet<Selement> manualInclusions = new ObjectSet<>(); final ObjectSet<Selement> manualInclusions = new ObjectSet<>();
public GroupDefinition(String name, ClassName bestType, Array<Stype> components, boolean spatial, boolean mapping, boolean collides){ public GroupDefinition(String name, ClassName bestType, Seq<Stype> components, boolean spatial, boolean mapping, boolean collides){
this.baseType = bestType; this.baseType = bestType;
this.components = components; this.components = components;
this.name = name; this.name = name;
@@ -787,14 +793,14 @@ public class EntityProcess extends BaseProcessor{
} }
class EntityDefinition{ class EntityDefinition{
final Array<GroupDefinition> groups; final Seq<GroupDefinition> groups;
final Array<Stype> components; final Seq<Stype> components;
final TypeSpec.Builder builder; final TypeSpec.Builder builder;
final Selement base; final Selement base;
final String name; final String name;
int classID; int classID;
public EntityDefinition(String name, Builder builder, Selement base, Array<Stype> components, Array<GroupDefinition> groups){ public EntityDefinition(String name, Builder builder, Selement base, Seq<Stype> components, Seq<GroupDefinition> groups){
this.builder = builder; this.builder = builder;
this.name = name; this.name = name;
this.base = base; this.base = base;

View File

@@ -69,7 +69,7 @@ public class AssetsProcess extends BaseProcessor{
}); });
for(Element elem : elements){ for(Element elem : elements){
Array.with(((TypeElement)elem).getEnclosedElements()).each(e -> e.getKind() == ElementKind.FIELD, field -> { Seq.with(((TypeElement)elem).getEnclosedElements()).each(e -> e.getKind() == ElementKind.FIELD, field -> {
String fname = field.getSimpleName().toString(); String fname = field.getSimpleName().toString();
if(fname.startsWith("default")){ if(fname.startsWith("default")){
loadStyles.addStatement("arc.Core.scene.addStyle(" + field.asType().toString() + ".class, mindustry.ui.Styles." + fname + ")"); loadStyles.addStatement("arc.Core.scene.addStyle(" + field.asType().toString() + ".class, mindustry.ui.Styles." + fname + ")");

View File

@@ -23,17 +23,17 @@ public class LoadRegionProcessor extends BaseProcessor{
.addParameter(tname("mindustry.ctype.MappableContent"), "content") .addParameter(tname("mindustry.ctype.MappableContent"), "content")
.addModifiers(Modifier.STATIC, Modifier.PUBLIC); .addModifiers(Modifier.STATIC, Modifier.PUBLIC);
ObjectMap<Stype, Array<Svar>> fieldMap = new ObjectMap<>(); ObjectMap<Stype, Seq<Svar>> fieldMap = new ObjectMap<>();
for(Svar field : fields(Load.class)){ for(Svar field : fields(Load.class)){
if(!field.is(Modifier.PUBLIC)){ if(!field.is(Modifier.PUBLIC)){
err("@LoadRegion field must be public", field); err("@LoadRegion field must be public", field);
} }
fieldMap.get(field.enclosingType(), Array::new).add(field); fieldMap.get(field.enclosingType(), Seq::new).add(field);
} }
for(Entry<Stype, Array<Svar>> entry : fieldMap){ for(Entry<Stype, Seq<Svar>> entry : fieldMap){
method.beginControlFlow("if(content instanceof $T)", entry.key.tname()); method.beginControlFlow("if(content instanceof $T)", entry.key.tname());
for(Svar field : entry.value){ for(Svar field : entry.value){

View File

@@ -83,7 +83,7 @@ public class RemoteReadGenerator{
readBlock.addStatement("$L $L = read.$L()", typeName, varName, pname); readBlock.addStatement("$L $L = read.$L()", typeName, varName, pname);
}else{ }else{
//else, try and find a serializer //else, try and find a serializer
String ser = serializers.readers.get(typeName, SerializerResolver.locate(entry.element, var.asType(), false)); String ser = serializers.readers.get(typeName.replace("mindustry.gen.", ""), SerializerResolver.locate(entry.element, var.asType(), false));
if(ser == null){ //make sure a serializer exists! if(ser == null){ //make sure a serializer exists!
BaseProcessor.err("No read method to read class type '" + typeName + "' in method " + entry.targetMethod + "; " + serializers.readers, var); BaseProcessor.err("No read method to read class type '" + typeName + "' in method " + entry.targetMethod + "; " + serializers.readers, var);

View File

@@ -139,7 +139,7 @@ public class RemoteWriteGenerator{
//reset stream //reset stream
method.addStatement("OUT.reset()"); method.addStatement("OUT.reset()");
method.addTypeVariables(Array.with(elem.getTypeParameters()).map(BaseProcessor::getTVN)); method.addTypeVariables(Seq.with(elem.getTypeParameters()).map(BaseProcessor::getTVN));
for(int i = 0; i < elem.getParameters().size(); i++){ for(int i = 0; i < elem.getParameters().size(); i++){
//first argument is skipped as it is always the player caller //first argument is skipped as it is always the player caller
@@ -174,7 +174,7 @@ public class RemoteWriteGenerator{
method.addStatement("WRITE.$L($L)", typeName.equals("boolean") ? "bool" : typeName.charAt(0) + "", varName); method.addStatement("WRITE.$L($L)", typeName.equals("boolean") ? "bool" : typeName.charAt(0) + "", varName);
}else{ }else{
//else, try and find a serializer //else, try and find a serializer
String ser = serializers.writers.get(typeName, SerializerResolver.locate(elem, var.asType(), true)); String ser = serializers.writers.get(typeName.replace("mindustry.gen.", ""), SerializerResolver.locate(elem, var.asType(), true));
if(ser == null){ //make sure a serializer exists! if(ser == null){ //make sure a serializer exists!
BaseProcessor.err("No @WriteClass method to write class type: '" + typeName + "'", var); BaseProcessor.err("No @WriteClass method to write class type: '" + typeName + "'", var);

View File

@@ -9,7 +9,7 @@ public class SerializerResolver{
public static String locate(ExecutableElement elem, TypeMirror mirror, boolean write){ public static String locate(ExecutableElement elem, TypeMirror mirror, boolean write){
//generic type //generic type
if((mirror.toString().equals("T") && Array.with(elem.getTypeParameters().get(0).getBounds()).contains(SerializerResolver::isEntity)) || if((mirror.toString().equals("T") && Seq.with(elem.getTypeParameters().get(0).getBounds()).contains(SerializerResolver::isEntity)) ||
isEntity(mirror)){ isEntity(mirror)){
return write ? "mindustry.io.TypeIO.writeEntity" : "mindustry.io.TypeIO.readEntity"; return write ? "mindustry.io.TypeIO.writeEntity" : "mindustry.io.TypeIO.readEntity";
} }

View File

@@ -1,5 +1,6 @@
package mindustry.annotations.util; package mindustry.annotations.util;
import arc.func.*;
import com.sun.tools.javac.code.*; import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Attribute.Array; import com.sun.tools.javac.code.Attribute.Array;
import com.sun.tools.javac.code.Attribute.Enum; import com.sun.tools.javac.code.Attribute.Enum;
@@ -10,16 +11,17 @@ import com.sun.tools.javac.code.Type;
import com.sun.tools.javac.code.Symbol.*; import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type.ArrayType; import com.sun.tools.javac.code.Type.ArrayType;
import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Name;
import com.sun.tools.javac.util.*; import com.sun.tools.javac.util.*;
import sun.reflect.annotation.*; import sun.reflect.annotation.*;
import javax.lang.model.element.*;
import javax.lang.model.type.*; import javax.lang.model.type.*;
import java.io.*; import java.lang.Class;
import java.lang.annotation.*; import java.lang.annotation.*;
import java.lang.reflect.*; import java.lang.reflect.*;
import java.util.*; import java.util.*;
import java.util.Map.*; import java.util.Map.*;
import java.lang.Class;
//replaces the standard Java AnnotationProxyMaker with one that doesn't crash //replaces the standard Java AnnotationProxyMaker with one that doesn't crash
//thanks, oracle. //thanks, oracle.
@@ -59,98 +61,65 @@ public class AnnotationProxyMaker{
} }
private Map<MethodSymbol, Attribute> getAllValues(){ private Map<MethodSymbol, Attribute> getAllValues(){
LinkedHashMap var1 = new LinkedHashMap(); LinkedHashMap map = new LinkedHashMap();
ClassSymbol var2 = (ClassSymbol)this.anno.type.tsym; ClassSymbol cl = (ClassSymbol)this.anno.type.tsym;
for(com.sun.tools.javac.code.Scope.Entry var3 = var2.members().elems; var3 != null; var3 = var3.sibling){ //try to use Java 8 API for this if possible
if(var3.sym.kind == 16){ try{
MethodSymbol var4 = (MethodSymbol)var3.sym; Class entryClass = Class.forName("com.sun.tools.javac.code.Scope$Entry");
Object members = cl.members();
Field field = members.getClass().getField("elems");
Object elems = field.get(members);
Field siblingField = entryClass.getField("sibling");
Field symField = entryClass.getField("sym");
for(Object currEntry = elems; currEntry != null; currEntry = siblingField.get(currEntry)){
handleSymbol((Symbol)symField.get(currEntry), map);
}
}catch(Throwable e){
//otherwise try other API
try{
Class lookupClass = Class.forName("com.sun.tools.javac.code.Scope$LookupKind");
Field nonRecField = lookupClass.getField("NON_RECURSIVE");
Object nonRec = nonRecField.get(null);
Scope scope = cl.members();
Method getSyms = scope.getClass().getMethod("getSymbols", lookupClass);
Iterable<Symbol> it = (Iterable<Symbol>)getSyms.invoke(scope, nonRec);
Iterator<Symbol> i = it.iterator();
while(i.hasNext()){
handleSymbol(i.next(), map);
}
}catch(Throwable death){
//I tried
throw new RuntimeException(death);
}
}
for(Pair var7 : this.anno.values){
map.put(var7.fst, var7.snd);
}
return map;
}
private void handleSymbol(Symbol sym, LinkedHashMap map){
if(sym.getKind() == ElementKind.METHOD){
MethodSymbol var4 = (MethodSymbol)sym;
Attribute var5 = var4.getDefaultValue(); Attribute var5 = var4.getDefaultValue();
if(var5 != null){ if(var5 != null){
var1.put(var4, var5); map.put(var4, var5);
} }
} }
} }
Iterator var6 = this.anno.values.iterator();
while(var6.hasNext()){
Pair var7 = (Pair)var6.next();
var1.put(var7.fst, var7.snd);
}
return var1;
}
private Object generateValue(MethodSymbol var1, Attribute var2){ private Object generateValue(MethodSymbol var1, Attribute var2){
AnnotationProxyMaker.ValueVisitor var3 = new AnnotationProxyMaker.ValueVisitor(var1); AnnotationProxyMaker.ValueVisitor var3 = new AnnotationProxyMaker.ValueVisitor(var1);
return var3.getValue(var2); return var3.getValue(var2);
} }
private static final class MirroredTypesExceptionProxy extends ExceptionProxy{
static final long serialVersionUID = 269L;
private transient List<TypeMirror> types;
private final String typeStrings;
MirroredTypesExceptionProxy(List<TypeMirror> var1){
this.types = var1;
this.typeStrings = var1.toString();
}
public String toString(){
return this.typeStrings;
}
public int hashCode(){
return (this.types != null ? this.types : this.typeStrings).hashCode();
}
public boolean equals(Object var1){
return this.types != null && var1 instanceof AnnotationProxyMaker.MirroredTypesExceptionProxy && this.types.equals(((AnnotationProxyMaker.MirroredTypesExceptionProxy)var1).types);
}
protected RuntimeException generateException(){
return new MirroredTypesException(this.types);
}
private void readObject(ObjectInputStream var1) throws IOException, ClassNotFoundException{
var1.defaultReadObject();
this.types = null;
}
}
private static final class MirroredTypeExceptionProxy extends ExceptionProxy{
static final long serialVersionUID = 269L;
private transient TypeMirror type;
private final String typeString;
MirroredTypeExceptionProxy(TypeMirror var1){
this.type = var1;
this.typeString = var1.toString();
}
public String toString(){
return this.typeString;
}
public int hashCode(){
return (this.type != null ? this.type : this.typeString).hashCode();
}
public boolean equals(Object var1){
return this.type != null && var1 instanceof AnnotationProxyMaker.MirroredTypeExceptionProxy && this.type.equals(((AnnotationProxyMaker.MirroredTypeExceptionProxy)var1).type);
}
protected RuntimeException generateException(){
return new MirroredTypeException(this.type);
}
private void readObject(ObjectInputStream var1) throws IOException, ClassNotFoundException{
var1.defaultReadObject();
this.type = null;
}
}
private class ValueVisitor implements Visitor{ private class ValueVisitor implements Visitor{
private MethodSymbol meth; private MethodSymbol meth;
private Class<?> returnClass; private Class<?> returnClass;
@@ -182,7 +151,7 @@ public class AnnotationProxyMaker{
} }
public void visitClass(com.sun.tools.javac.code.Attribute.Class var1){ public void visitClass(com.sun.tools.javac.code.Attribute.Class var1){
this.value = new AnnotationProxyMaker.MirroredTypeExceptionProxy(var1.classType); this.value = mirrorProxy(var1.classType);
} }
public void visitArray(Array var1){ public void visitArray(Array var1){
@@ -199,7 +168,7 @@ public class AnnotationProxyMaker{
var14.append(var8); var14.append(var8);
} }
this.value = new AnnotationProxyMaker.MirroredTypesExceptionProxy(var14.toList()); this.value = mirrorProxy(var14.toList());
}else{ }else{
int var3 = var1.values.length; int var3 = var1.values.length;
Class var4 = this.returnClass; Class var4 = this.returnClass;
@@ -236,7 +205,7 @@ public class AnnotationProxyMaker{
try{ try{
this.value = java.lang.Enum.valueOf((Class)this.returnClass, var2); this.value = java.lang.Enum.valueOf((Class)this.returnClass, var2);
}catch(IllegalArgumentException var4){ }catch(IllegalArgumentException var4){
this.value = new EnumConstantNotPresentExceptionProxy((Class)this.returnClass, var2); this.value = proxify(() -> new EnumConstantNotPresentException((Class)this.returnClass, var2));
} }
}else{ }else{
this.value = null; this.value = null;
@@ -256,7 +225,7 @@ public class AnnotationProxyMaker{
public void visitError(Error var1){ public void visitError(Error var1){
if(var1 instanceof UnresolvedClass){ if(var1 instanceof UnresolvedClass){
this.value = new AnnotationProxyMaker.MirroredTypeExceptionProxy(((UnresolvedClass)var1).classType); this.value = mirrorProxy(((UnresolvedClass)var1).classType);
}else{ }else{
this.value = null; this.value = null;
} }
@@ -264,24 +233,30 @@ public class AnnotationProxyMaker{
} }
private void typeMismatch(Method var1, final Attribute var2){ private void typeMismatch(Method var1, final Attribute var2){
class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy{ this.value = proxify(() -> new AnnotationTypeMismatchException(var1, var2.type.toString()));
static final long serialVersionUID = 269L; }
final transient Method method;
AnnotationTypeMismatchExceptionProxy(Method var2x){
this.method = var2x;
} }
public String toString(){ private static Object mirrorProxy(Type t){
return "<error>"; return proxify(() -> new MirroredTypeException(t));
} }
private static Object mirrorProxy(List<Type> t){
return proxify(() -> new MirroredTypesException(t));
}
private static <T extends Throwable> Object proxify(Prov<T> prov){
try{
return new ExceptionProxy(){
@Override
protected RuntimeException generateException(){ protected RuntimeException generateException(){
return new AnnotationTypeMismatchException(this.method, var2.type.toString()); return (RuntimeException)prov.get();
} }
};
}catch(Throwable t){
throw new RuntimeException(t);
} }
this.value = new AnnotationTypeMismatchExceptionProxy(var1);
}
} }
} }

View File

@@ -1,6 +1,6 @@
package mindustry.annotations.util; package mindustry.annotations.util;
import arc.struct.Array; import arc.struct.*;
import arc.util.ArcAnnotate.*; import arc.util.ArcAnnotate.*;
import com.squareup.javapoet.*; import com.squareup.javapoet.*;
import com.sun.tools.javac.code.Attribute.*; import com.sun.tools.javac.code.Attribute.*;
@@ -23,8 +23,8 @@ public class Selement<T extends Element>{
return BaseProcessor.elementu.getDocComment(e); return BaseProcessor.elementu.getDocComment(e);
} }
public Array<Selement<?>> enclosed(){ public Seq<Selement<?>> enclosed(){
return Array.with(e.getEnclosedElements()).map(Selement::new); return Seq.with(e.getEnclosedElements()).map(Selement::new);
} }
public String fullName(){ public String fullName(){
@@ -55,8 +55,8 @@ public class Selement<T extends Element>{
return e instanceof ExecutableElement; return e instanceof ExecutableElement;
} }
public Array<? extends AnnotationMirror> annotations(){ public Seq<? extends AnnotationMirror> annotations(){
return Array.with(e.getAnnotationMirrors()); return Seq.with(e.getAnnotationMirrors());
} }
public <A extends Annotation> A annotation(Class<A> annotation){ public <A extends Annotation> A annotation(Class<A> annotation){
@@ -106,6 +106,6 @@ public class Selement<T extends Element>{
@Override @Override
public boolean equals(Object o){ public boolean equals(Object o){
return o != null && o.getClass() == getClass() && e == ((Selement)o).e; return o != null && o.getClass() == getClass() && e.equals(((Selement)o).e);
} }
} }

View File

@@ -21,6 +21,10 @@ public class Smethod extends Selement<ExecutableElement>{
return false; return false;
} }
public String descString(){
return up().asType().toString() + "#" + super.toString().replace("mindustry.gen.", "");
}
public boolean is(Modifier mod){ public boolean is(Modifier mod){
return e.getModifiers().contains(mod); return e.getModifiers().contains(mod);
} }
@@ -29,20 +33,20 @@ public class Smethod extends Selement<ExecutableElement>{
return new Stype((TypeElement)up()); return new Stype((TypeElement)up());
} }
public Array<TypeMirror> thrown(){ public Seq<TypeMirror> thrown(){
return Array.with(e.getThrownTypes()).as(); return Seq.with(e.getThrownTypes()).as();
} }
public Array<TypeName> thrownt(){ public Seq<TypeName> thrownt(){
return Array.with(e.getThrownTypes()).map(TypeName::get); return Seq.with(e.getThrownTypes()).map(TypeName::get);
} }
public Array<TypeParameterElement> typeVariables(){ public Seq<TypeParameterElement> typeVariables(){
return Array.with(e.getTypeParameters()).as(); return Seq.with(e.getTypeParameters()).as();
} }
public Array<Svar> params(){ public Seq<Svar> params(){
return Array.with(e.getParameters()).map(Svar::new); return Seq.with(e.getParameters()).map(Svar::new);
} }
public boolean isVoid(){ public boolean isVoid(){

View File

@@ -20,19 +20,19 @@ public class Stype extends Selement<TypeElement>{
return mirror().toString(); return mirror().toString();
} }
public Array<Stype> interfaces(){ public Seq<Stype> interfaces(){
return Array.with(e.getInterfaces()).map(Stype::of); return Seq.with(e.getInterfaces()).map(Stype::of);
} }
public Array<Stype> allInterfaces(){ public Seq<Stype> allInterfaces(){
return interfaces().flatMap(s -> s.allInterfaces().and(s)).distinct(); return interfaces().flatMap(s -> s.allInterfaces().and(s)).distinct();
} }
public Array<Stype> superclasses(){ public Seq<Stype> superclasses(){
return Array.with(BaseProcessor.typeu.directSupertypes(mirror())).map(Stype::of); return Seq.with(BaseProcessor.typeu.directSupertypes(mirror())).map(Stype::of);
} }
public Array<Stype> allSuperclasses(){ public Seq<Stype> allSuperclasses(){
return superclasses().flatMap(s -> s.allSuperclasses().and(s)).distinct(); return superclasses().flatMap(s -> s.allSuperclasses().and(s)).distinct();
} }
@@ -40,17 +40,17 @@ public class Stype extends Selement<TypeElement>{
return new Stype((TypeElement)BaseProcessor.typeu.asElement(BaseProcessor.typeu.directSupertypes(mirror()).get(0))); return new Stype((TypeElement)BaseProcessor.typeu.asElement(BaseProcessor.typeu.directSupertypes(mirror()).get(0)));
} }
public Array<Svar> fields(){ public Seq<Svar> fields(){
return Array.with(e.getEnclosedElements()).select(e -> e instanceof VariableElement).map(e -> new Svar((VariableElement)e)); return Seq.with(e.getEnclosedElements()).select(e -> e instanceof VariableElement).map(e -> new Svar((VariableElement)e));
} }
public Array<Smethod> methods(){ public Seq<Smethod> methods(){
return Array.with(e.getEnclosedElements()).select(e -> e instanceof ExecutableElement return Seq.with(e.getEnclosedElements()).select(e -> e instanceof ExecutableElement
&& !e.getSimpleName().toString().contains("<")).map(e -> new Smethod((ExecutableElement)e)); && !e.getSimpleName().toString().contains("<")).map(e -> new Smethod((ExecutableElement)e));
} }
public Array<Smethod> constructors(){ public Seq<Smethod> constructors(){
return Array.with(e.getEnclosedElements()).select(e -> e instanceof ExecutableElement return Seq.with(e.getEnclosedElements()).select(e -> e instanceof ExecutableElement
&& e.getSimpleName().toString().contains("<")).map(e -> new Smethod((ExecutableElement)e)); && e.getSimpleName().toString().contains("<")).map(e -> new Smethod((ExecutableElement)e));
} }

View File

@@ -12,6 +12,10 @@ public class Svar extends Selement<VariableElement>{
super(e); super(e);
} }
public String descString(){
return up().asType().toString() + "#" + super.toString().replace("mindustry.gen.", "");
}
public JCVariableDecl jtree(){ public JCVariableDecl jtree(){
return (JCVariableDecl)BaseProcessor.elementu.getTree(e); return (JCVariableDecl)BaseProcessor.elementu.getTree(e);
} }

View File

@@ -19,19 +19,19 @@ public class TypeIOResolver{
ClassSerializer out = new ClassSerializer(new ObjectMap<>(), new ObjectMap<>(), new ObjectMap<>()); ClassSerializer out = new ClassSerializer(new ObjectMap<>(), new ObjectMap<>(), new ObjectMap<>());
for(Stype type : processor.types(TypeIOHandler.class)){ for(Stype type : processor.types(TypeIOHandler.class)){
//look at all TypeIOHandler methods //look at all TypeIOHandler methods
Array<Smethod> methods = type.methods(); Seq<Smethod> methods = type.methods();
for(Smethod meth : methods){ for(Smethod meth : methods){
if(meth.is(Modifier.PUBLIC) && meth.is(Modifier.STATIC)){ if(meth.is(Modifier.PUBLIC) && meth.is(Modifier.STATIC)){
Array<Svar> params = meth.params(); Seq<Svar> params = meth.params();
//2 params, second one is type, first is writer //2 params, second one is type, first is writer
if(params.size == 2 && params.first().tname().toString().equals("arc.util.io.Writes")){ if(params.size == 2 && params.first().tname().toString().equals("arc.util.io.Writes")){
out.writers.put(params.get(1).tname().toString(), type.fullName() + "." + meth.name()); out.writers.put(fix(params.get(1).tname().toString()), type.fullName() + "." + meth.name());
}else if(params.size == 1 && params.first().tname().toString().equals("arc.util.io.Reads") && !meth.isVoid()){ }else if(params.size == 1 && params.first().tname().toString().equals("arc.util.io.Reads") && !meth.isVoid()){
//1 param, one is reader, returns type //1 param, one is reader, returns type
out.readers.put(meth.retn().toString(), type.fullName() + "." + meth.name()); out.readers.put(fix(meth.retn().toString()), type.fullName() + "." + meth.name());
}else if(params.size == 2 && params.first().tname().toString().equals("arc.util.io.Reads") && !meth.isVoid() && meth.ret() == meth.params().get(1).mirror()){ }else if(params.size == 2 && params.first().tname().toString().equals("arc.util.io.Reads") && !meth.isVoid() && meth.ret() == meth.params().get(1).mirror()){
//2 params, one is reader, other is type, returns type - these are made to reduce garbage allocated //2 params, one is reader, other is type, returns type - these are made to reduce garbage allocated
out.mutatorReaders.put(meth.retn().toString(), type.fullName() + "." + meth.name()); out.mutatorReaders.put(fix(meth.retn().toString()), type.fullName() + "." + meth.name());
} }
} }
} }
@@ -40,6 +40,11 @@ public class TypeIOResolver{
return out; return out;
} }
/** makes sure type names don't contain 'gen' */
private static String fix(String str){
return str.replace("mindustry.gen", "");
}
/** Information about read/write methods for class types. */ /** Information about read/write methods for class types. */
public static class ClassSerializer{ public static class ClassSerializer{
public final ObjectMap<String, String> writers, readers, mutatorReaders; public final ObjectMap<String, String> writers, readers, mutatorReaders;

View File

@@ -4,20 +4,21 @@ alpha=0
block=1 block=1
cix=2 cix=2
draug=3 draug=3
mindustry.entities.comp.BulletComp=4 mace=4
mindustry.entities.comp.DecalComp=5 mindustry.entities.comp.BulletComp=5
mindustry.entities.comp.EffectComp=6 mindustry.entities.comp.DecalComp=6
mindustry.entities.comp.FireComp=7 mindustry.entities.comp.EffectComp=7
mindustry.entities.comp.PlayerComp=8 mindustry.entities.comp.FireComp=8
mindustry.entities.comp.PuddleComp=9 mindustry.entities.comp.LaunchCoreComp=21
mindustry.entities.comp.TileComp=10 mindustry.entities.comp.PlayerComp=9
mindustry.type.Weather.WeatherComp=11 mindustry.entities.comp.PuddleComp=10
mindustry.world.blocks.campaign.CoreLauncher.LaunchCoreComp=20 mindustry.entities.comp.TileComp=11
mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=12 mindustry.type.Weather.WeatherComp=12
oculon=13 mindustry.world.blocks.campaign.CoreLauncher.LaunchCoreComp=13
phantom=14 mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=14
tau=19 oculon=15
titan=15 phantom=16
tau=17
trident=18 trident=18
vanguard=16 vanguard=19
wraith=17 wraith=20

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:payloads,type:arc.struct.Array<mindustry.world.blocks.payloads.Payload>,size:-1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:payloads,type:arc.struct.Seq<mindustry.world.blocks.payloads.Payload>,size:-1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:payloads,type:arc.struct.Seq<mindustry.world.blocks.payloads.Payload>,size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:payloads,type:arc.struct.Seq<mindustry.world.blocks.payloads.Payload>,size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:requests,type:arc.struct.Queue<mindustry.entities.units.BuildRequest>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:2,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:collided,type:arc.struct.IntArray,size:-1},{name:damage,type:float,size:4},{name:data,type:java.lang.Object,size:-1},{name:lifetime,type:float,size:4},{name:owner,type:Entityc,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:type,type:mindustry.entities.bullet.BulletType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:collided,type:arc.struct.IntSeq,size:-1},{name:damage,type:float,size:4},{name:data,type:java.lang.Object,size:-1},{name:lifetime,type:float,size:4},{name:owner,type:Entityc,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:type,type:mindustry.entities.bullet.BulletType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:lifetime,type:float,size:4},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:block,type:mindustry.world.Block,size:-1},{name:lifetime,type:float,size:4},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +0,0 @@
{version:1,fields:[{name:block,type:mindustry.world.Block,size:-1},{name:lifetime,type:float,size:4},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +0,0 @@
{version:2,fields:[{name:block,type:mindustry.world.Block,size:-1},{name:lifetime,type:float,size:4},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:lifetime,type:float,size:4},{name:stacks,type:arc.struct.Array<mindustry.type.ItemStack>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:lifetime,type:float,size:4},{name:stacks,type:arc.struct.Seq<mindustry.type.ItemStack>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:accepting,type:float,size:4},{name:amount,type:float,size:4},{name:generation,type:int,size:4},{name:lastRipple,type:float,size:4},{name:liquid,type:mindustry.type.Liquid,size:-1},{name:tile,type:mindustry.world.Tile,size:-1},{name:updateTime,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:amount,type:float,size:4},{name:generation,type:int,size:4},{name:liquid,type:mindustry.type.Liquid,size:-1},{name:tile,type:mindustry.world.Tile,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +0,0 @@
{version:1,fields:[{name:amount,type:float,size:4},{name:generation,type:int,size:4},{name:liquid,type:mindustry.type.Liquid,size:-1},{name:tile,type:mindustry.world.Tile,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +0,0 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -1 +1 @@
{fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Array<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]} {fields:[{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -0,0 +1 @@
{version:1,fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@@ -36,6 +36,7 @@ allprojects{
if(!project.hasProperty("versionType")) versionType = 'official' if(!project.hasProperty("versionType")) versionType = 'official'
appName = 'Mindustry' appName = 'Mindustry'
steamworksVersion = '891ed912791e01fe9ee6237a6497e5212b85c256' steamworksVersion = '891ed912791e01fe9ee6237a6497e5212b85c256'
rhinoVersion = 'eeb327d141146663ff3924bd20d2a5da8a6439cc'
loadVersionProps = { loadVersionProps = {
return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p } return new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p }
@@ -171,7 +172,11 @@ allprojects{
jcenter() jcenter()
} }
tasks.withType(Javadoc).all{ enabled = false } tasks.withType(JavaCompile){
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = "UTF-8"
}
} }
project(":desktop"){ project(":desktop"){
@@ -185,13 +190,13 @@ project(":desktop"){
implementation arcModule("natives:natives-box2d-desktop") implementation arcModule("natives:natives-box2d-desktop")
implementation arcModule("natives:natives-desktop") implementation arcModule("natives:natives-desktop")
implementation arcModule("natives:natives-freetype-desktop") implementation arcModule("natives:natives-freetype-desktop")
implementation 'com.github.MinnDevelopment:java-discord-rpc:v2.0.1'
if(debugged()) implementation project(":debug") if(debugged()) implementation project(":debug")
implementation "com.github.Anuken:steamworks4j:$steamworksVersion" implementation "com.github.Anuken:steamworks4j:$steamworksVersion"
implementation arcModule("backends:backend-sdl") implementation arcModule("backends:backend-sdl")
implementation 'com.github.MinnDevelopment:java-discord-rpc:v2.0.1'
} }
} }
@@ -270,7 +275,7 @@ project(":core"){
api arcModule("extensions:g3d") api arcModule("extensions:g3d")
api arcModule("extensions:fx") api arcModule("extensions:fx")
api arcModule("extensions:arcnet") api arcModule("extensions:arcnet")
api "org.mozilla:rhino-runtime:1.7.12" api "com.github.Anuken:rhino:$rhinoVersion"
if(localArc() && debugged()) api arcModule("extensions:recorder") if(localArc() && debugged()) api arcModule("extensions:recorder")
compileOnly project(":annotations") compileOnly project(":annotations")

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 895 B

View File

@@ -2,7 +2,7 @@
duplicatePadding: true, duplicatePadding: true,
combineSubdirectories: true, combineSubdirectories: true,
flattenPaths: true, flattenPaths: true,
maxWidth: 2048, maxWidth: 4096,
maxHeight: 2048, maxHeight: 4096,
fast: true fast: true
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 651 B

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Some files were not shown because too many files have changed in this diff Show More