//
//  MeetDragCardView.swift

//
//  Created by AI Assistant on 2024/12/19.
//  Copyright © 2024年 Crush. All rights reserved.
//

import UIKit
import SnapKit

class MeetDragCardView: UIView {
    
    var originTransForm: CGAffineTransform = .identity
    var configure: MeetDragConfigure?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUp()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        setUp()
    }
    
    private func setUp() {
        isUserInteractionEnabled = true
        // backgroundColor = UIColor.cyan
    }
    
    func setConfigure(_ configure: MeetDragConfigure) {
        self.configure = configure
        //设置卡片样式
        layer.cornerRadius = configure.cardCornerRadius
        layer.borderWidth = configure.cardCornerBorderWidth
        layer.borderColor = configure.cardBordColor.cgColor
        layer.masksToBounds = true
    }
    
    /// 布局子视图，其子类重写，并在其进行布局
    func YFLDragCardViewLayoutSubviews() {
        // 子类重写此方法进行布局
    }
    
    /// 执行卡片上动画(喜欢、不喜欢)
    func startAnimatingForDirection(_ direction: ContainerDragDirection) {
        // 🔥 根据上下文推测：执行动画效果
        switch direction {
        case .left:
            // 不喜欢动画
            break
        case .right:
            // 喜欢动画
            break
        case .up:
            // 向上动画
            break
        case .down:
            // 向下动画
            break
        default:
            break
        }
    }
}
