"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlagsService = void 0;
class FlagsService {
    flags = {};
    log = false;
    constructor(flags = [], log = false) {
        this.register(flags);
        this.log = log;
    }
    register(flags) {
        flags.forEach((flag) => {
            this.flags[flag] = false;
        });
    }
    enable(flag) {
        this.flags[flag] = true;
        if (this.log) {
            console.log(`${flag} is now enabled \n`);
        }
    }
    disable(flag) {
        this.flags[flag] = false;
        if (this.log) {
            console.log(`${flag} is now disabled \n`);
        }
    }
    flip(flag) {
        this.flags[flag] = !this.flags[flag];
        if (this.log) {
            const status = this.flags[flag] ? "enabled" : "disabled";
            const message = `${flag} is now ${status}`;
            console.log(message);
        }
    }
    enableLogging() {
        this.log = true;
    }
    disableLogging() {
        this.log = false;
    }
    enabled(flag) {
        return this.flags[flag];
    }
}
exports.FlagsService = FlagsService;
//# sourceMappingURL=flags.js.map