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
31 changes: 30 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,40 @@ const jobTypes = {
pilot: 'MAV',
mechanic: 'Repair Ship',
commander: 'Main Ship',
programmer: 'Any Ship!'
programmer: 'Any Ship!'
};

// 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(obj) {
this.ship = obj;
obj.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
}
}
}




Expand Down