//
//  PlayerHolder.swift
//  PadelClub
//
//  Created by Razmig Sarkissian on 24/04/2024.
//

import Foundation

protocol PlayerHolder {

    func getFirstName() -> String
    func getLastName() -> String
    func formattedRank() -> String
    func formattedLicense() -> String
    func getPoints() -> Double?
    func getRank() -> Int?
    func isUnranked() -> Bool
    var male: Bool { get }
    var tournamentPlayed: Int? { get }
    var clubName: String? { get }
    var ligueName: String? { get }
    var assimilation: String? { get }
    var computedAge: Int? { get }
    func getAssimilatedAsMaleRank() -> Int?
}

extension PlayerHolder {
    var isAssimilated: Bool {
        assimilation == "Oui"
    }
    
    func isAnonymous() -> Bool {
        getFirstName().isEmpty && getLastName().isEmpty
    }
}
