Abstract class mob inherits from entity

This commit is contained in:
jordan4ibanez 2022-08-01 02:33:18 -04:00
parent ac0011e094
commit bee23bc3c4
2 changed files with 13 additions and 9 deletions

View File

@ -10,15 +10,6 @@ void main()
}
abstract class Mob {
float health;
abstract void onSpawn();
abstract void onTick(double delta);
abstract void onHurt();
abstract void onDeath();
abstract void onDeathPoof();
}
class Zombie : Mob {
this() {

13
source/entity/mob/mob.d Normal file
View File

@ -0,0 +1,13 @@
module entity.mob.mob;
import entity.entity;
// The base class for all mobs
abstract class Mob : Entity {
float health;
abstract void onSpawn();
abstract void onTick(double delta);
abstract void onHurt();
abstract void onDeath();
abstract void onDeathPoof();
}