@andreabiagini5/applicazioni-e-servizi-web-project
Version:
Project for Applicazioni e Servizi Web.
25 lines • 650 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RatingFactory = void 0;
class RatingFactory {
}
exports.RatingFactory = RatingFactory;
/**
* Creates a new rating with the given rating.
* @param rating the rating value.
* @returns the rating object.
*/
RatingFactory.create = (rating) => new EloRating(rating);
const DEFAULT_RATING = 1500;
class EloRating {
constructor(value) {
this._value = value !== null && value !== void 0 ? value : DEFAULT_RATING;
}
valueOf() {
return this._value;
}
get value() {
return this._value;
}
}
//# sourceMappingURL=Rating.js.map