using UnityEngine;
using System.Collections;
using System.Text.RegularExpressions;

public class ElementLocation : MonoBehaviour {

    public int row;
    public int column;

    public bool inGridTrue = false;

    void OnTriggerEnter2D(Collider2D col)
    {
        string name = Regex.Replace(col.transform.parent.name, "[0-9]", "");

        if (name == "C")
            column = System.Convert.ToInt32(col.gameObject.name);
        else if (name == "R")
        {
            row = System.Convert.ToInt32(col.gameObject.name);
        }
        else if (name == "Grid")
            inGridTrue = true;
    }
}
