Implementation begins

This commit is contained in:
Anuken
2020-02-02 17:42:00 -05:00
parent ad84329688
commit 63fa50d111
4 changed files with 50 additions and 12 deletions

View File

@@ -12,7 +12,9 @@ import mindustry.content.*;
import mindustry.ctype.*;
import mindustry.entities.bullet.*;
import mindustry.entities.units.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.net.*;
import mindustry.type.*;
import java.io.*;
@@ -21,9 +23,9 @@ import static mindustry.Vars.content;
public class EntityComps{
@Depends({HealthComp.class, VelComp.class, StatusComp.class})
@Depends({HealthComp.class, VelComp.class, StatusComp.class, TeamComp.class, ItemsComp.class})
class UnitComp{
//UnitDef type;
}
class OwnerComp{
@@ -35,7 +37,13 @@ public class EntityComps{
BulletType bullet;
void init(){
bullet.init();
//TODO
bullet.init(null);
}
void remove(){
//TODO
bullet.despawned(null);
}
}
@@ -65,6 +73,27 @@ public class EntityComps{
}
}
class FlyingComp{
boolean flying;
}
class LegsComp{
}
class RotComp{
float rotation;
}
class TeamComp{
Team team = Team.sharded;
}
@Depends(PosComp.class)
class SyncComp{
Interpolator interpolator;
}
abstract class PosComp implements Position{
float x, y;
@@ -74,9 +103,24 @@ public class EntityComps{
}
}
abstract class DamageComp{
abstract float getDamage();
}
class MinerComp{
}
class BuilderComp{
}
class ItemsComp{
ItemStack item = new ItemStack();
}
@Depends(PosComp.class)
class VelComp{
//transient fields act as imports from any other component clases; these are ignored by the generator
transient float x, y;
final Vec2 vel = new Vec2();