More components, less entities

This commit is contained in:
Anuken
2020-02-02 23:38:16 -05:00
parent f2f31120a0
commit f937cb30f0
77 changed files with 586 additions and 570 deletions

View File

@@ -145,12 +145,12 @@ public class EntityProcess extends BaseProcessor{
//only write the block if it's a void method with several entries
boolean writeBlock = first.ret().toString().equals("void") && entry.value.size > 1;
if(entry.value.first().is(Modifier.ABSTRACT) && entry.value.size == 1){
if((entry.value.first().is(Modifier.ABSTRACT) || entry.value.first().is(Modifier.NATIVE)) && entry.value.size == 1){
err(entry.value.first().up().getSimpleName() + " declares an abstract method. This method must be implemented in another component", entry.value.first());
}
for(Smethod elem : entry.value){
if(elem.is(Modifier.ABSTRACT)) continue;
if(elem.is(Modifier.ABSTRACT) || elem.is(Modifier.NATIVE)) continue;
//get all statements in the method, copy them over
MethodTree methodTree = elem.tree();
@@ -262,6 +262,8 @@ public class EntityProcess extends BaseProcessor{
if(!componentDependencies.containsKey(component)){
ObjectSet<Stype> out = new ObjectSet<>();
out.addAll(component.superclasses());
//TODO extreme confusion
//out.addAll(component.interfaces().select(this::isComponent));
//get dependency classes
if(component.annotation(Component.class) != null){
@@ -289,6 +291,10 @@ public class EntityProcess extends BaseProcessor{
return componentDependencies.get(component);
}
boolean isComponent(Stype type){
return type.annotation(Component.class) != null;
}
TypeMirror[] mirrors(Stype type){
try{
type.annotation(EntityDef.class).value();