Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mars mission #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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: 30 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,41 @@ const jobTypes = {

// Your code will go here

// this creates a CrewMember and passes the following arguments into its constructor:
// 'name', 'job', 'specialty'
class CrewMember {
constructor (name, job, specialSkill, ship) {
this.name = name;
this.job = job;
this.specialSkill = specialSkill;
this.ship = ship;
}
enterShip(x) {
this.ship = x;
x.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
}
}
}





// Begin by reading the tests and building a function that will full each one.
// Begin by reading the tests and building a function that will fullfil each one.
// As you build, you might not have to build them in order, maybe you do...
// These are the tests
if (typeof describe === 'function'){
Expand Down