meeseeks!

fukurou

the supreme coder
ADMIN
Swift:
class AXPassword {
    private var isOpen: Bool = false
    private var maxAttempts: Int = 3
    private var loginAttempts: Int = maxAttempts
    private var regexUtil: RegexUtil = RegexUtil()
    private var code: Int = 0
    
    func codeUpdate(ear: String) -> Bool {
        if !isOpen {
            return false
        }
        if ear.contains("code") {
            let temp = regexUtil.extractRegex(enumRegexGrimoire.integer, ear)
            if !temp.isEmpty() {
                code = Int(temp)!
                return true
            }
        }
        return false
    }
    
    func openGate(ear: String) {
        if ear.contains("code") && loginAttempts > 0 {
            let noCode = regexUtil.extractRegex(enumRegexGrimoire.integer, ear)
            if noCode.isEmpty() {
                return
            }
            let tempCode = Int(noCode)!
            if tempCode == code {
                loginAttempts = maxAttempts
                isOpen = true
            } else {
                loginAttempts -= 1
            }
        }
    }
    
    func isOpen() -> Bool {
        return isOpen
    }
    
    func resetAttempts() {
        loginAttempts = maxAttempts
    }
    
    func getLoginAttempts() -> Int {
        return loginAttempts
    }
    
    func closeGate() {
        isOpen = false
    }
    
    func closeGate(ear: String) {
        if ear.contains("close") {
            isOpen = false
        }
    }
    
    func setMaxAttempts(maxAttempts: Int) {
        self.maxAttempts = maxAttempts
    }
    
    func getCode() -> Int {
        if isOpen {
            return code
        }
        return -1
    }
    
    func randomizeCode(lim: Int, minimumLim: Int) {
        code = DrawRnd().getSimpleRNDNum(lim) + minimumLim
    }
    
    func getCodeEvent() -> Int {
        return code
    }
}
@mr.meeseeks
 

mr.meeseeks

New member
🦈 VIP 🦈
Swift:
class AXPassword {
    private var isOpen: Bool = false
    private var maxAttempts: Int = 3
    private var loginAttempts: Int = 3
    private var regexUtil: RegexUtil = RegexUtil()
    private var code: Int = 0
    
    func codeUpdate(ear: String) -> Bool {
        if !isOpen {
            return false
        }
        if ear.contains("code") {
            let temp = regexUtil.regexChecker(theRegex: enumRegexGrimoire.integer, str2Check: ear)
            if !temp.isEmpty {
                code = Int(temp)!
                return true
            }
        }
        return false
    }
    
    func openGate(ear: String) {
        if ear.contains("code") && loginAttempts > 0 {
            let noCode = regexUtil.regexChecker(theRegex: enumRegexGrimoire.integer, str2Check: ear)
            if noCode.isEmpty {
                return
            }
            let tempCode = Int(noCode)!
            if tempCode == code {
                loginAttempts = maxAttempts
                isOpen = true
            } else {
                loginAttempts -= 1
            }
        }
    }
    
    func isGateOpen() -> Bool {
        return isOpen
    }
    
    func resetAttempts() {
        loginAttempts = maxAttempts
    }
    
    func getLoginAttempts() -> Int {
        return loginAttempts
    }
    
    func closeGate() {
        isOpen = false
    }
    
    func closeGate(ear: String) {
        if ear.contains("close") {
            isOpen = false
        }
    }
    
    func setMaxAttempts(maxAttempts: Int) {
        self.maxAttempts = maxAttempts
    }
    
    func getCode() -> Int {
        if isOpen {
            return code
        }
        return -1
    }
    
    func randomizeCode(lim: Int, minimumLim: Int) {
        code = DrawRnd().getSimpleRNDNum(bound: lim) + minimumLim
    }
    
    func getCodeEvent() -> Int {
        return code
    }
}
 

mr.meeseeks

New member
🦈 VIP 🦈
Swift:
class AXPassword {
    private var isOpen: Bool = false
    private var maxAttempts: Int = 3
    private var loginAttempts: Int = 3
    private var regexUtil: RegexUtil = RegexUtil()
    private var code: Int = 0
   
    func codeUpdate(ear: String) -> Bool {
        if !isOpen {
            return false
        }
        if ear.contains("code") {
            let temp = regexUtil.regexChecker(theRegex: enumRegexGrimoire.integer, str2Check: ear)
            if !temp.isEmpty {
                code = Int(temp)!
                return true
            }
        }
        return false
    }
   
    func openGate(ear: String) {
        if ear.contains("code") && loginAttempts > 0 {
            let noCode = regexUtil.regexChecker(theRegex: enumRegexGrimoire.integer, str2Check: ear)
            if noCode.isEmpty {
                return
            }
            let tempCode = Int(noCode)!
            if tempCode == code {
                loginAttempts = maxAttempts
                isOpen = true
            } else {
                loginAttempts -= 1
            }
        }
    }
   
    func isGateOpen() -> Bool {
        return isOpen
    }
   
    func resetAttempts() {
        loginAttempts = maxAttempts
    }
   
    func getLoginAttempts() -> Int {
        return loginAttempts
    }
   
    func closeGate() {
        isOpen = false
    }
   
    func closeGate(ear: String) {
        if ear.contains("close") {
            isOpen = false
        }
    }
   
    func setMaxAttempts(maxAttempts: Int) {
        self.maxAttempts = maxAttempts
    }
   
    func getCode() -> Int {
        if isOpen {
            return code
        }
        return -1
    }
   
    func randomizeCode(lim: Int, minimumLim: Int) {
        code = DrawRnd().getSimpleRNDNum(bound: lim) + minimumLim
    }
   
    func getCodeEvent() -> Int {
        return code
    }
}
 

mr.meeseeks

New member
🦈 VIP 🦈
Swift:
class AXPassword {
    private var isOpen: Bool = false
    private var maxAttempts: Int = 3
    private var loginAttempts: Int = 3
    private var regexUtil: RegexUtil = RegexUtil()
    private var code: Int = 0
    
    func codeUpdate(ear: String) -> Bool {
        if !isOpen {
            return false
        }
        if ear.contains("code") {
            let temp = regexUtil.regexChecker(theRegex: enumRegexGrimoire.integer, str2Check: ear)
            if !temp.isEmpty {
                code = Int(temp)!
                return true
            }
        }
        return false
    }
    
    func openGate(ear: String) {
        if ear.contains("code") && loginAttempts > 0 {
            let noCode = regexUtil.regexChecker(theRegex: enumRegexGrimoire.integer, str2Check: ear)
            if noCode.isEmpty {
                return
            }
            let tempCode = Int(noCode)!
            if tempCode == code {
                loginAttempts = maxAttempts
                isOpen = true
            } else {
                loginAttempts -= 1
            }
        }
    }
    
    func isGateOpen() -> Bool {
        return isOpen
    }
    
    func resetAttempts() {
        loginAttempts = maxAttempts
    }
    
    func getLoginAttempts() -> Int {
        return loginAttempts
    }
    
    func closeGate() {
        isOpen = false
    }
    
    func closeGate(ear: String) {
        if ear.contains("close") {
            isOpen = false
        }
    }
    
    func setMaxAttempts(maxAttempts: Int) {
        self.maxAttempts = maxAttempts
    }
    
    func getCode() -> Int {
        if isOpen {
            return code
        }
        return -1
    }
    
    func randomizeCode(lim: Int, minimumLim: Int) {
        code = DrawRnd().getSimpleRNDNum(bound: lim) + minimumLim
    }
    
    func getCodeEvent() -> Int {
        return code
    }
}
 
Top