Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ <h1>Hello World!</h1>
<button onclick="displayDate()">Click Me</button>
<hr/>
</body>
</html> -->
</html> -->

<!-- Push Blah -->
30 changes: 30 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}



Expand Down