using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CardFactory : MonoBehaviour
{

    public GameObject CardPrefab = null;

    public CardInstance CreateCard(Card template)
    {
        GameObject go = GameObject.Instantiate(CardPrefab, new Vector3(0.0f, -3.0f, 0.0f), Quaternion.Euler(180.0f, 0.0f, 0.0f)) as GameObject;
        CardInstance ci = go.GetComponent<CardInstance>();
        if (ci != null)
        {
            ci.CardTemplate = template;
        }
        else
        {
            print("WARNING: CardPrefab does not have a CardInstance component");
        }

        return ci;
    }

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
