From 0a6c4e03a612d5d54258a6c3cb89c9b4f0238027 Mon Sep 17 00:00:00 2001 From: DavidStephenss Date: Mon, 27 Jul 2020 10:38:44 -0500 Subject: [PATCH 1/2] firstcommit --- main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index afa4c17..18f87e9 100644 --- a/main.js +++ b/main.js @@ -10,7 +10,13 @@ const jobTypes = { }; // Your code will go here - +class bob { + constructor(name, job, specialSkill, dob){ + this.name = 'bob'; + this.job = '6ft'; + this.specialSkill = '250'; + this.ship = ''; + } From 0bbbe4e987b74a015230d43c4c453c3db34f2c06 Mon Sep 17 00:00:00 2001 From: DavidStephenss Date: Mon, 27 Jul 2020 16:25:23 -0500 Subject: [PATCH 2/2] done --- main.js | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index 18f87e9..f650289 100644 --- a/main.js +++ b/main.js @@ -10,13 +10,39 @@ const jobTypes = { }; // Your code will go here -class bob { - constructor(name, job, specialSkill, dob){ - this.name = 'bob'; - this.job = '6ft'; - this.specialSkill = '250'; - this.ship = ''; +//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 + } + } +} +