Example #1
0
 public static void NodeSubscribe <T>(this Behaviour behaviour, JNode node, JNodeEvent eventFilter, Action <T> action, bool alwaysActive = false) where T : JNode
 {
     behaviour.NodeSubscribe(node, eventFilter, n =>
     {
         if (n is T jNode)
         {
             action(jNode);
         }
     }, alwaysActive);
 }
Example #2
0
 public static void NodeSubscribe <T>(this IService service, JNode node, JNodeEvent eventFilter, Action <T> action) where T : JNode
 {
     service.NodeSubscribe(node, eventFilter, n =>
     {
         if (n is T jNode)
         {
             action(jNode);
         }
     });
 }
Example #3
0
        public static void NodeSubscribe(this IService service, JNode node, JNodeEvent eventFilter, Action <JNode> action)
        {
            var linkHandler = new ObjectLinkHandler <IService>(service);

            node.Subscribe(linkHandler, (n, e) =>
            {
                if (e == eventFilter)
                {
                    action(n);
                }
            });
        }
Example #4
0
    public static void NodeSubscribe(this State state, JNode node, JNodeEvent eventFilter, Action <JNode> action)
    {
        var linkHandler = new StateLinkHandler(state);

        node.Subscribe(linkHandler, (n, e) =>
        {
            if (e == eventFilter)
            {
                action(n);
            }
        });
    }
Example #5
0
        public static void NodeSubscribe(this Behaviour behaviour, JNode node, JNodeEvent eventFilter, Action <JNode> action, bool alwaysActive = false)
        {
            var linkHandler = new BehaviourLinkHandler(behaviour, alwaysActive);

            node.Subscribe(linkHandler, (n, e) =>
            {
                if (e == eventFilter)
                {
                    action(n);
                }
            });
        }
Example #6
0
 public static void NodeSubscribe(this IService service, JNode node, JNodeEvent eventFilter, Action action)
 {
     service.NodeSubscribe(node, eventFilter, n => action());
 }
Example #7
0
 public static void NodeSubscribe(this State state, JNode node, JNodeEvent eventFilter, Action action)
 {
     state.NodeSubscribe(node, eventFilter, n => action());
 }
Example #8
0
 public static void NodeSubscribe(this Behaviour behaviour, JNode node, JNodeEvent eventFilter, Action action, bool alwaysActive = false)
 {
     behaviour.NodeSubscribe(node, eventFilter, n => action(), alwaysActive);
 }