2021-03-08 11:56:52 +01:00
|
|
|
export class Operations {
|
2021-05-03 15:20:07 +02:00
|
|
|
protected _operationsConsumed = 0;
|
2021-03-08 11:56:52 +01:00
|
|
|
|
|
|
|
|
consumeOperation(): Operations {
|
|
|
|
|
return this.consumeOperations(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
consumeOperations(quantity: Readonly<number>): Operations {
|
2021-05-03 15:20:07 +02:00
|
|
|
this._operationsConsumed += quantity;
|
2021-03-08 11:56:52 +01:00
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-03 15:20:07 +02:00
|
|
|
getConsumedOperationsCount(): number {
|
|
|
|
|
return this._operationsConsumed;
|
2021-03-08 11:56:52 +01:00
|
|
|
}
|
|
|
|
|
}
|