//
//  ArKitViewRepresentable.swift
//  ArkitDoushiQi
//
//  Created by Enzo JOLYS on 12/06/2024.
//

import Foundation
import SwiftUI
import DouShouQiModel

struct ArKitViewRepresentable : UIViewRepresentable {
    
    var vm:VMArkit
    
    init(_ game:Game){
        vm = VMArkit(game)
    }
    
    func makeUIView(context: Context) -> ArKitView {
        let arView = ArKitView()
        let anchor = arView.defineAnchors()
        vm.setup(anchor)
        arView.addGesture(vm.pieces)
        return arView
    }
    
    func updateUIView(_ uiView: UIViewType, context: Context) { }
}
