public void Link(params LinkDef[] def) { foreach (var d in def) { Clay.Connect(this, d.Clay, d.ConnectPoint, d.ConnectPoint); } }
public override void Disconnect(Clay withClay, object atConnectPoint) { if (_contacts.ContainsKey(atConnectPoint) && _contacts[atConnectPoint] == withClay) { _contacts.Remove(atConnectPoint); } }
public override void Connect(Clay withClay, object atConnectPoint) { var agr = (Agreement as SAgreement); if (agr._links.ContainsKey(atConnectPoint)) { agr._links[atConnectPoint].Link(new LinkDef(withClay, atConnectPoint)); base.Connect(withClay, atConnectPoint); } }
public object this[object cp] { get { return(myClay.Recall(cp)); } set { if (myClay._contacts.ContainsKey(cp)) { Clay.Vibrate(myClay._contacts[cp], cp, value, myClay); } } }
public override void Connect(Clay withClay, object atConnectPoint) { if (withClay is Conduit) { var c = _contacts.FirstOrDefault(x => x.Clay == withClay); if (c != null) { return; } } _contacts.Add(new Contact(withClay, atConnectPoint)); }
protected override void OnSignal(Clay fromClay, object atConnectPoint, object signal) { var valid = _contacts.Contains(new Contact(fromClay, atConnectPoint)); if (valid) { foreach (var c in _contacts) { if (!c.ConnectPoint.Equals(atConnectPoint) || c.Clay != fromClay) { if ((Agreement as CAgreement).ParallelTrx) { Task.Run(() => Clay.Vibrate(c.Clay, c.ConnectPoint, signal, this)); } else { Clay.Vibrate(c.Clay, c.ConnectPoint, signal, this); } } } } }
protected override void OnSignal(Clay fromClay, object atConnectPoint, object signal) { if (++_one == 1) { OnInit(); } lock (_locker) { if (_contacts.ContainsKey(atConnectPoint) && _contacts[atConnectPoint] == fromClay && IsValidSensorPoint(atConnectPoint)) { SetSignal(atConnectPoint, signal); if (IsAllSignalsReady()) { if ((Agreement as RAgreement).IsStaged) { _collected.Clear(); } OnResponse(atConnectPoint); } } } }
public Contact(Clay clay, object connectPoint) { Clay = clay; ConnectPoint = connectPoint; }
public static void Connect(Clay clay1, Clay clay2, object atCp1, object atCp2 = null) { clay1.Connect(clay2, atCp1); clay2.Connect(clay1, atCp2 == null ? atCp1 : atCp2); }
internal static void Vibrate(Clay clay, object atConnectPoint, object signal, Clay srcClay) { clay.OnSignal(srcClay, atConnectPoint, signal); }
protected abstract void OnSignal(Clay fromClay, object atConnectPoint, object signal);
public abstract void Disconnect(Clay withClay, object atConnectPoint);
public LinkDef(Clay clay, object cp) { Clay = clay; ConnectPoint = cp; }
public override void Connect(Clay withClay, object atConnectPoint) { _contacts[atConnectPoint] = withClay; }
public void Link(LinkDef def) { Clay.Connect(this, def.Clay, def.ConnectPoint, def.ConnectPoint); }
public override void Disconnect(Clay withClay, object atConnectPoint) { _contacts.Remove(new Contact(withClay, atConnectPoint)); }