Abstract component method support
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user