Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';

const assert = require('assert');

// This is an object that has types of jobs and the values each provide.
Expand All @@ -11,6 +12,34 @@ 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;
}
enterShip(shipName) {
this.ship = shipName
shipName.crew.push(this)
}
}

class Ship {
constructor(name, type, ability, crew) {
this.name = name;
this.type = type;
this.ability = ability;
this.crew = [];
}
missionStatement() {
if (this.crew.length >= 1) {
return this.ability
} else {
return "Can't perform a mission yet."
}
}
}



Expand Down