//
//  PlayerExtension.swift
//  DouShouQi_App
//
//  Created by étudiant on 04/06/2024.
//

import Foundation
import DouShouQiModel

public class PlayerVM: ObservableObject, Identifiable, Hashable{
    public static func == (lhs: PlayerVM, rhs: PlayerVM) -> Bool {
            return lhs.id == rhs.id
        }
        
        public func hash(into hasher: inout Hasher) {
            hasher.combine(id)
        }
    
    @Published var player: Player
    var loose: Int{
        return 0
    }
    var win: Int{
        return 0
    }
    var rank: Int{
        return 0
    }
    
    
    //public func getPlayer(name: String): PlayerVM{}
    
    
    init(player: Player) {
        self.player = player
    }
    
    convenience init() {
        self.init(player: Player(name: "IA", photo: ""))
    }

}

