forked from LaunchCodeEducation/Mars-Rover-Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage.js
More file actions
21 lines (19 loc) · 697 Bytes
/
message.js
File metadata and controls
21 lines (19 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const Command = require("./command.js");
class Message {
constructor(name, commands) {
this.name = name;
if(!name) {
throw Error("Name required.");
}
this.commands = commands;
//commands = commands.push([new Command('MODE_CHANGE', 'LOW_POWER'), new Command('MOVE', 12000), new Command('STATUS_CHECK')]);
}
// Write code here
}
//let name = new Message('Curiosity');
let commands = ([new Command('MODE_CHANGE', 'LOW_POWER'), new Command('MOVE', 12000), new Command('STATUS_CHECK')]);
let message = new Message('Test message with two commands', commands);
//console.log(name);
//console.log(commands);
console.log(message);
module.exports = Message;