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

public class Tile {
    public TileType Type { get { return tileType; } }
    public Vector2 Position { get { return position; } }
    public bool IsOn { get { return _isOn; } set { _isOn = value; script.SetEnabled(value); } }

    private Vector2 position;
    private TileType tileType;
    public TileScript script;

    private bool _isOn;

    public Tile(TileType type, Vector2 position, bool startOn) {
        this.position = position;
        this.tileType = type;
        this._isOn = startOn;
    }

    public void ForceActivated(ForceType force) {
        //Debug.LogFormat("Force {0} affects type {1}: {2}", force.name, Type.GetType().ToString(), Type.DoesForceAffect(force));
        if (Type.DoesForceAffect(force)) {
            //Debug.LogFormat("Effect: {0}", Type.GetForceEffect(force));
            IsOn = Type.GetForceEffect(force);
        }
    }

    public void ForceDeactivated(ForceType force) {

    }
}
