diff --git a/main.js b/main.js index afa4c17..70ada47 100644 --- a/main.js +++ b/main.js @@ -11,12 +11,40 @@ const jobTypes = { // Your code will go here +class CrewMember { + constructor(name, job, specialSkill, ship){ + this.name = name; + this.job = job; + this.specialSkill = specialSkill; + this.ship = ship; + } + //Crew can enter ship + // | + // V + enterShip(ship) { + this.ship = ship; + this.ship.crew.push(this); + } +} - - - - - + //Class for ship + // | + // V +class Ship { + constructor(name, type, ability){ + this.name = name; + this.type = type; + this.ability = ability; + this.crew = []; + } + missionStatement() { + if (this.crew.length === 0) { + return "Can't perform a mission yet." + } else { + return this.ability; + } + } +} // Begin by reading the tests and building a function that will full each one. // As you build, you might not have to build them in order, maybe you do... // These are the tests