protected override Pipe VisitInput(InputSegment input) { if (input == null) return null; var output = input.Output; if (output.MessageType == _messageType && !_found) { _found = true; Pipe newOutput = _buildSegment(Visit(output)); input.ReplaceOutput(output, newOutput); return input; } Pipe pipe = Visit(output); if (pipe != output) { input.ReplaceOutput(output, pipe); } return input; }
protected override Pipe VisitInput(InputSegment input) { _lastNodeVertex = GetSink(input.GetHashCode(), () => "Input", typeof(InputSegment), input.MessageType); if (_stack.Count > 0) _edges.Add(new Edge(_stack.Peek(), _lastNodeVertex, _lastNodeVertex.TargetType.Name)); return Recurse(() => base.VisitInput(input)); }
protected virtual Pipe VisitInput(InputSegment input) { if (input == null) return null; Pipe output = input.Output; Pipe pipe = Visit(output); if (pipe != output) input.ReplaceOutput(output, pipe); return input; }
public void Setup() { _addCalled = new Future<bool>(); _removeCalled = new Future<bool>(); _input = PipeSegment.Input(PipeSegment.End()); _subscriberScope = _input.NewSubscriptionScope(); _subscriberScope.Subscribe<SubscriberAdded>(x => _addCalled.Complete(true)); _subscriberScope.Subscribe<SubscriberRemoved>(x => _removeCalled.Complete(true)); using (var scope = _input.NewSubscriptionScope()) { scope.Subscribe<ClaimModified>(x => { }); } }
protected override Pipe VisitInput(InputSegment input) { Pipe pipe = base.VisitInput(input); if (pipe != input) throw new InvalidOperationException("The input should never change"); if (!_bound && input.MessageType == _messageType) { CreateRecipientList(input, _messageType); } if (!_bound && input.MessageType == typeof (object)) { CreateRecipientList(input, typeof (object)); } return input; }
protected override Pipe VisitInput(InputSegment input) { Pipe pipe = base.VisitInput(input); if (pipe != input) { throw new InvalidOperationException("The input should never change"); } if (!_bound && input.MessageType == _messageType) { CreateRecipientList(input, _messageType); } if (!_bound && input.MessageType == typeof(object)) { CreateRecipientList(input, typeof(object)); } return(input); }
public void Setup() { _addCalled = new Future<bool>(); _removeCalled = new Future<bool>(); _input = PipeSegment.Input(PipeSegment.End()); _subscriberScope = _input.NewSubscriptionScope(); _subscriberScope.Subscribe<SubscriberAdded>(x => { if(x.MessageType == typeof(ClaimModified)) _addCalled.Complete(true); }); _subscriberScope.Subscribe<SubscriberRemoved>(x => { if (x.MessageType == typeof(ClaimModified)) _removeCalled.Complete(true); }); using (ISubscriptionScope scope = _input.NewSubscriptionScope()) { scope.Subscribe<ClaimModified>(x => { }); } }
protected override Pipe VisitInput(InputSegment input) { WriteLine(input); return(base.VisitInput(input)); }
public InputSegmentEditCommand(CoinKernelViewModel coinKernelVm, InputSegment segment) { this.CoinKernelVm = coinKernelVm; this.Segment = segment; }
static MagnumMessenger() { myMessageBus = PipeSegment.Input(PipeSegment.End()); mySubscriptionScope = myMessageBus.NewSubscriptionScope(); }
/// <summary> /// This should only be used by the local player. /// It assumes this input is for the latest frame. /// </summary> /// <param name="pnum">Player index</param> /// <param name="segment">Input data</param> /// <returns></returns> public int SaveInput(int pnum, InputSegment segment) { int frame = frames[pnum].Count; frames[pnum].Add(segment); return frame; }
public void SendGameMessage(InputSegment segment) { int frame = inputTracker.SaveInput(localPlayerNum, segment); byte[] data = inputTracker.GetData(localPlayerNum, frame); for (int i = 0; i < UDP_SEND_COUNT; ++i) { udp.SendData(data); } }
public MagnumMessenger() { _messageBus = PipeSegment.Input(PipeSegment.End()); _subscriptionScope = _messageBus.NewSubscriptionScope(); }
private void CreateRecipientList(InputSegment input, Type messageType) { var recipients = input.Output.SegmentType == PipeSegmentType.End ? new Pipe[] {} : new[] {input.Output}; Pipe list = PipeSegment.RecipientList(messageType, recipients); Pipe result = Visit(list); input.ReplaceOutput(input.Output, result); }