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

public class PlayerInventory : MonoBehaviour {
	Dictionary<string,int> _Inventory;
	
	void Awake()
	{
		_Inventory = new Dictionary<string,int>();
	}

	bool CheckInventory(string item)
	{
		if(_Inventory.ContainsKey(item))
			return true;

		return false;
	}

	public void AddItem(string item)
	{
		if(CheckInventory(item))
		{
			_Inventory[item]++;
		}
		else
		{
			_Inventory.Add(item, 1);
		}
		Debug.Log(item + ": " + GetItemCount(item));
	}

	public int GetItemCount(string item)
	{
		if(CheckInventory(item))
		{
			//Debug.Log("Problem item: " + item);
			return _Inventory[item];
		}

		return 0;
	}
}