Grub
class Grub {
constructor(food, eat, age, color) {
this.food = food
this.age = 0
this.color = 'pink'
this.food = 'jelly'
}
eat() {
return 'Mmmmmmmmm jelly'
}
}
module.exports = Grub;
Bee
const Grub = require('./Grub');
class Bee extends Grub{
constructor(age, color, food) {
super(age, color, food)
this.age = 5
this.color = 'yellow'
this.job = 'Keep on growing'
}
}
module.exports = Bee;
ForagerBee
const Grub = require('./Grub');
class Bee extends Grub{
constructor(age, color, food) {
super(age, color, food)
this.age = 5
this.color = 'yellow'
this.job = 'Keep on growing'
}
}
module.exports = Bee;
HoneymakerBee
const Bee = require('./Bee');
class HoneyMakerBee extends Bee{
constructor(age, job, color, food, eat) {
super(color, food, eat, age, job)
this.age = 10
this.job = 'make honey'
this.honeyPot = 0
}
makeHoney() {
return this.honeyPot++
}
giveHoney() {
return this.honeyPot--
}
}
module.exports = HoneyMakerBee;