using UnityEngine;
using System.Collections;

public class GridObject : MonoBehaviour
{
    private GridCoord m_gridPosition;
    private GridCoord m_committedGridPosition;

    public bool m_canBeSelectedByAction;

    public GridObject()
    {
        m_canBeSelectedByAction = false;
    }

    public GridCoord GridPosition
    {
        get { return m_gridPosition; }
    }

    public GridCoord CommitedGridPosition
    {
        get { return m_committedGridPosition; }
    }

    public void UpdatePosition( GridCoord pos, bool commit )
    {
        m_gridPosition = pos;
        Transform transCom = GetComponent<Transform>();
        transCom.position = m_gridPosition.GetUnityPos();

        if ( commit )
        {
            m_committedGridPosition = pos;
        }
    }

    public void SetCanBeSelectedByAction()
    {
        m_canBeSelectedByAction = true;
    }

	// Use this for initialization
	void Start () 
    {
	
	}
	
	// Update is called once per frame
	void Update ()
    {
	
	}


}
