Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @returns {Object}
- */
- function createAssemblyLine() {
- let decorators = {};
- /**
- *
- * @param {Object} obj
- */
- decorators.hasClima = function(obj) {
- obj.temp = 21;
- obj.tempSettings = 21;
- obj.adjustTemp = function() {(obj.temp < obj.tempSettings) ? obj.temp += 1 : (obj.temp > obj.tempSettings)? obj.temp -= 1 : obj.temp}
- };
- /**
- *
- * @param {Object} obj
- */
- decorators.hasAudio = function(obj) {
- obj.currentTrack = null;
- obj.nowPlaying = function() { if (obj.currentTrack !== null) console.log(`Now playing ${obj.currentTrack.name} by ${obj.currentTrack.artist}`); }
- };
- /**
- *
- * @param {Object} obj
- */
- decorators.hasParktronic = function(obj) {
- obj.checkDistance = function(distance) {
- if (distance < 0.1) {
- console.log('Beep! Beep! Beep!');
- } else if (0.1 <= distance && distance < 0.25) {
- console.log('Beep! Beep!');
- } else if (0.25 <= distance && distance < 0.5) {
- console.log('Beep!');
- } else {console.log('');}
- };
- };
- return decorators;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement