namespace TACO { using System; public abstract class Connector : Part { private Slot mSlot1; private Slot mSlot2; public Connector(string id) : base(id) { } public abstract bool CanConnectWith(Slot slot); public void Connect(Slot slot1, Slot slot2) { if (CanConnectWith(slot1) && CanConnectWith(slot2)) { /* TODO: Disconnect existing slots. Use Delegates. */ mSlot1 = slot1; mSlot2 = slot2; } else { /* TODO: Throw an exception */ } } public Slot Slot1 { get { return mSlot1; } } public Slot Slot2 { get { return mSlot2; } } } }