Ejemplo n.º 1
0
        public void Wire(Node node, CachedNodeStateInfo state)
        {
            Timer timer = node.CreateConnectedTimer(_timeoutMethod, _processMode, _waitTime, _oneShot, _autostart);

            timer.Name = Utils.NormalizeMemberName(state.Name);
            state.SetValue(node, timer);
        }
Ejemplo n.º 2
0
        public void Wire(Node node, CachedNodeStateInfo state)
        {
            Node nodeToReference;

            if (_matchType == MatchTypes.Type)
            {
                nodeToReference = (Node)node.GetChildren().First(c => state.StateType.IsInstanceOfType(c));
            }
            else
            {
                NodePath nodePath = Utils.NormalizeMemberName(state.Name);
                nodeToReference = node.GetNode(nodePath);
            }
            state.SetValue(node, nodeToReference);
        }
Ejemplo n.º 3
0
        public void Wire(Node node, CachedNodeStateInfo state)
        {
            TimerSystem timerSystem = node.AddAndReturnChild(new TimerSystem());

            timerSystem.Name   = Utils.NormalizeMemberName(state.Name);
            timerSystem.Parent = node;

            // Field-Defined TimerReceivers
            foreach (TimerReceiverAttribute attribute in state.GetAttributes().OfType <TimerReceiverAttribute>())
            {
                timerSystem.AddTimer(attribute.TimeoutMethod, attribute.ProcessMode, attribute.WaitTime, attribute.OneShot,
                                     attribute.Autostart);
            }

            // Method-Defined TimerReceivers
            CachedNodeMethodInfo[] compatibleMethods = state.DeclaringType.GetMethods().Where(m => m.GetAttribute <TimerReceiverAttribute>() != null).ToArray();
            foreach (CachedNodeMethodInfo method in compatibleMethods)
            {
                TimerReceiverAttribute attribute = method.GetAttribute <TimerReceiverAttribute>();
                timerSystem.AddTimer(method.Name, attribute.ProcessMode, attribute.WaitTime, attribute.OneShot, attribute.Autostart);
            }

            state.SetValue(node, timerSystem);
        }
Ejemplo n.º 4
0
 public void Wire(Node node, CachedNodeStateInfo state)
 {
     state.SetValue(node, node.GetParent());
 }
Ejemplo n.º 5
0
 public void Wire(Node node, CachedNodeStateInfo state)
 {
     state.SetValue(node, node.GetTree().GetNodeOfType(state.StateType));
 }
Ejemplo n.º 6
0
 public void Wire(Node node, CachedNodeStateInfo state)
 {
     state.SetValue(node, node.GetNode(_path));
 }