contract Management is Ownable{
    using Roles for Roles.Role;

    event ManagerAdded(address indexed account);
    event ManagerRemoved(address indexed account);

    Roles.Role private _managers;
    uint256 private _managerslevel;

    constructor ()  internal {
        // addManager(msg.sender);
        _managerslevel = 10;
    }

    modifier onlyManager()  {
        require(isManager(msg.sender), "Management: caller is not the manager");
        _;
    }
    function managerslevel() public view returns(uint256){
        return _managerslevel;
    }
    function isManager(address account) public view returns (bool) {
        return _managers.has(account);
    }
    // function addManager(address account) public onlyOwner {
    //     _addManager(account);
    // }

    function renounceManager(address account) public onlyOwner {
        _removeManager(account);
    }

    function _addManager(address account) internal {
        _managers.add(account);
        emit ManagerAdded(account);
    }

    function _removeManager(address account) internal {
        _managers.remove(account);
        emit ManagerRemoved(account);
    }
}
//管理分配
function renounceManager(address account) public onlyOwner {
    _removeManager(account);
}

// function addManager(address account) public onlyOwner {
//     _addManager(account);
// }