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

public class SocketScript : MonoBehaviour {

	public plugType requiredPlug = plugType.USB;
	public bool symmetrical = false;

	[HideInInspector] public bool connected = false;
	[HideInInspector] public GameObject connectedTo = null;
	/*[HideInInspector]*/ public int signalReceivedSocket = -1;


	void Update () {
		if (connected) {
			if (signalReceivedSocket >= 0) {
				connectedTo.GetComponent<PlugScript> ().signalReceivedPlug = signalReceivedSocket;
			} else if (connectedTo.GetComponent<PlugScript> ().signalReceivedPlug >= 0) {
				signalReceivedSocket = connectedTo.GetComponent<PlugScript> ().signalReceivedPlug;
			}
		}
	}

	public void Signalize (int signalIndex) {
		signalReceivedSocket = signalIndex;
	}
}
