Example #1
0
        public static BehaviorProperty <T> Blackboard(string variableName)
        {
            var new_prop = new BehaviorProperty <T>();

            new_prop.type        = BehaviorPropertyType.Blackboard;
            new_prop.variableVal = variableName;
            return(new_prop);
        }
Example #2
0
        public static BehaviorProperty <T> Static(T val)
        {
            var new_prop = new BehaviorProperty <T>();

            new_prop.type      = BehaviorPropertyType.Static;
            new_prop.staticVal = val;
            return(new_prop);
        }
Example #3
0
        public static BehaviorProperty <T> Func(Func <Blackboard, T> func)
        {
            var new_prop = new BehaviorProperty <T>();

            new_prop.type    = BehaviorPropertyType.Func;
            new_prop.funcVal = func;
            return(new_prop);
        }
Example #4
0
        public SetAndCheck()
        {
            Predicate = BehaviorProperty <bool> .Func(bb => {
                object value;
                if (Func != null)
                {
                    value = Func();
                }
                else
                {
                    value = FuncBlackboard(bb);
                }

                if (value == null)
                {
                    return(false);
                }

                bb.Set(Destination, value);
                return(true);
            });
        }
Example #5
0
 public IsSet()
 {
     Predicate = BehaviorProperty <bool> .Func(bb => bb.Contains(Source) && bb.Get <object>(Source) != null);
 }
Example #6
0
 public void SetFunc <T>(Func <Blackboard, T> value)
 {
     Set(BehaviorProperty <T> .Func(value));
 }
Example #7
0
 public void SetStatic <T>(T value)
 {
     Set(BehaviorProperty <T> .Static(value));
 }