diff --git a/index.html b/index.html index d3f6be7..ea31b83 100644 --- a/index.html +++ b/index.html @@ -12,4 +12,6 @@

Hello World!


- --> + --> + + diff --git a/main.js b/main.js index afa4c17..af6d917 100644 --- a/main.js +++ b/main.js @@ -10,7 +10,37 @@ const jobTypes = { }; // Your code will go here +class CrewMember { + constructor(name,job,specialSkill,ship1){ + this.name = name + this.job = job; + this.specialSkill = specialSkill; + this.ship = ship1 ? ship1 : null +// if ship1 is defined ship equals ship1 else ship = null // + } + enterShip(ship){ + this.ship = ship; + ship.crew.push(this); + } +} + +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 + } + } +}