warriorjs-ja
Version:
Game written in JavaScript for learning JavaScript and artificial intelligence
80 lines (72 loc) • 2.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Config = function () {
function Config() {
_classCallCheck(this, Config);
}
_createClass(Config, null, [{
key: 'reset',
value: function reset() {
var _this = this;
['_pathPrefix', '_skipInput', '_delay', '_inStream', '_outStream', '_practiceLevel'].forEach(function (prop) {
if (_this.hasOwnProperty(prop)) {
delete _this[prop];
}
});
}
}, {
key: 'pathPrefix',
get: function get() {
return this._pathPrefix || '.';
},
set: function set(path) {
this._pathPrefix = path;
}
}, {
key: 'skipInput',
get: function get() {
return this._skipInput;
},
set: function set(skip) {
this._skipInput = skip;
}
}, {
key: 'delay',
get: function get() {
return this._delay || 0.6;
},
set: function set(delay) {
this._delay = delay;
}
}, {
key: 'inStream',
get: function get() {
return this._inStream;
},
set: function set(stream) {
this._inStream = stream;
}
}, {
key: 'outStream',
get: function get() {
return this._outStream;
},
set: function set(stream) {
this._outStream = stream;
}
}, {
key: 'practiceLevel',
get: function get() {
return this._practiceLevel;
},
set: function set(practiceLevel) {
this._practiceLevel = practiceLevel;
}
}]);
return Config;
}();
exports.default = Config;