1
0
Fork 0
BangleApps/apps/buffgym/buffgym-set.js

46 lines
674 B
JavaScript
Raw Normal View History

2020-04-20 20:39:30 +00:00
exports = class Set {
constructor(maxReps) {
this._minReps = 0;
this._maxReps = maxReps;
this._reps = 0;
this._completed = false;
}
get title() {
return this._title;
}
get weight() {
return this._weight;
}
isCompleted() {
return !!this._completed;
}
setCompleted() {
this._completed = true;
}
get reps() {
return this._reps;
}
get maxReps() {
return this._maxReps;
}
incReps() {
if (this._completed) return;
if (this._reps >= this._maxReps) return;
this._reps++;
}
decReps() {
if (this._completed) return;
if (this._reps <= this._minReps) return;
this._reps--;
}
}