lotto-draw
Version:
A simple tool used to pick random elements from a mutable collection of weighted participants
40 lines (39 loc) • 1.28 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Participant = void 0;
/**
* A participant that holds a number of tickets.
*/
var Participant = /** @class */ (function () {
/**
* Creates an instance of the Participant class.
* @param participant The actual participant.
* @param tickets The number of tickets held by the participant.
*/
function Participant(participant, tickets) {
if (tickets === void 0) { tickets = 1; }
this._participant = participant;
this._tickets = tickets;
}
Object.defineProperty(Participant.prototype, "participant", {
/** Gets the actual participant. */
get: function () {
return this._participant;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Participant.prototype, "tickets", {
/** Gets or sets the number of tickets held by the participant. */
get: function () {
return this._tickets;
},
set: function (value) {
this._tickets = value;
},
enumerable: false,
configurable: true
});
return Participant;
}());
exports.Participant = Participant;