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
51 changes: 50 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,67 @@
'use strict';
const assert = require('assert');



// This is an object that has types of jobs and the values each provide.
const jobTypes = {
pilot: 'MAV',
mechanic: 'Repair Ship',
commander: 'Main Ship',
programmer: 'Any Ship!'
};
// CrewMember class with all of it's values.
class CrewMember {
constructor(name, job, specialSkill, ship) {
this.name = name;
this.job = job;
this.specialSkill = specialSkill;
this.ship = null;
}
// enterShip is a function.
enterShip = (mav) => {
this.ship = mav;
mav.crew.push(crewMember1);
}
}

// Ship class with all of it's values.
class Ship {
constructor(name, type, ability, crew) {
this.name = name;
this.type = type;
this.ability = ability;
this.crew = [];
}

// missionStatement = () => {
// return "Can't perform a mission yet.";
// }
// get missionStatement() {
// if (crewMember1) {
// return `${mav.ability}`;
// }
// else if (crewMember2) {
// return `${hermes.ability}`;
// }
// }
}

// Your code will go here
// Creates a crew member by calling CrewMember class.
const crewMember1 = new CrewMember("Rick Martinez", "pilot", "chemistry");
const crewMember2 = new CrewMember('Commander Lewis', 'commander', 'geology');

// Creates the two different ship with their own values.
let mav = new Ship("Mars Ascent Vehicle", "MAV", "Ascend into low orbit");
let hermes = new Ship('Hermes', 'Main Ship', 'Interplanetary Space Travel');

// Unit Test 2 allows crew member to enter Ship
crewMember1.enterShip(mav);

// mav.missionStatement();
// hermes.missionStatement();
// crewMember1.enterShip(mav);
// crewMember2.enterShip(hermes);



Expand Down