Abstract component method support

This commit is contained in:
Anuken
2020-02-02 17:21:35 -05:00
parent ae6d33cad1
commit ad84329688
4 changed files with 28 additions and 10 deletions

View File

@@ -30,8 +30,17 @@ public class EntityComps{
Entityc owner;
}
class TimedComp extends EntityComp implements Scaled{
float time, lifetime = 1f;
@Depends({TimedComp.class})
class BulletComp{
BulletType bullet;
void init(){
bullet.init();
}
}
abstract class TimedComp extends EntityComp implements Scaled{
float time, lifetime;
void update(){
time = Math.min(time + Time.delta(), lifetime);
@@ -205,14 +214,6 @@ public class EntityComps{
}
}
class BulletComp{
BulletType bullet;
void init(){
bullet.init();
}
}
@BaseComponent
class EntityComp{
int id;