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
32 changes: 32 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ const jobTypes = {
};

// Your code will go here
//create a class for the crew
class CrewMember {
constructor(name, job, specialSkill, ship){
this.name = name;
this.job = job;
this.specialSkill = specialSkill;
this.ship = ship;
}
//make an entership function
enterShip(enter) {
this.ship = enter
enter.crew.push(this)
}
}

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



Expand Down