BeesBeesBees

김범주·2022년 3월 9일
0

Code Review

목록 보기
1/15

Grub

class Grub {
  // TODO..
  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{
  // TODO..
  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{
  // TODO..
  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{
  // TODO..
  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;
profile
개발꿈나무

0개의 댓글