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



public class Hand : MonoBehaviour {

	public int mode = 0;

	public GameObject play;
	public GameObject discard;

	public Object Card;
	public Vector2[] positions = new Vector2[5];

	public CardData[] cardsList;

	private GameObject[] cards;

	public void DrawCard()
	{
		for(int i = 0; i < positions.Length; ++i)
		{
			if (cards [i] == null) {
				GameObject newObject = Instantiate (Card) as GameObject;
				Card objCard = newObject.GetComponent <Card> ();
				int index = Random.Range (0, cardsList.Length);
				objCard.selectCard (cardsList [index]);
				newObject.transform.position = positions [i];
				cards [i] = newObject;
			}
		}
	}

	// Use this for initialization
	void Start () {
		cards = new GameObject[5];
	}
}
