Esempio n. 1
0
        public static NodeState Tick(int index, INodeBlob blob, IBlackboard bb)
        {
            var typeId = blob.GetTypeId(index);
            var state  = _TICKS[typeId](index, blob, bb);

            blob.SetState(index, state);
            return(state);
        }
Esempio n. 2
0
        public static IEnumerable <ComponentType> GetAccessTypes(int index, INodeBlob blob)
        {
            var typeId       = blob.GetTypeId(index);
            var ptr          = blob.GetRuntimeDataPtr(index);
            var node         = MetaNodeRegister.NODES[typeId];
            var runtimeTypes = node.RuntimeTypes.SelectMany(r => r.Func.Invoke(ptr + r.Offset));

            return(node.StaticTypes.Concat(runtimeTypes));
        }
Esempio n. 3
0
        public static NodeState Tick(int index, INodeBlob blob, IBlackboard bb)
        {
            var typeId = blob.GetTypeId(index);
            var ptr    = blob.GetRuntimeDataPtr(index);
            var state  = MetaNodeRegister.NODES[typeId].Tick.Invoke(ptr, index, blob, bb);

            blob.SetState(index, state);
            return(state);
        }
Esempio n. 4
0
 public static void Reset(int fromIndex, INodeBlob blob, IBlackboard bb, int count = 1)
 {
     blob.ResetStates(fromIndex, count);
     blob.ResetRuntimeData(fromIndex, count);
     for (var i = fromIndex; i < fromIndex + count; i++)
     {
         var typeId = blob.GetTypeId(i);
         _RESETS[typeId](i, blob, bb);
     }
 }
Esempio n. 5
0
 public static void Reset(int fromIndex, INodeBlob blob, IBlackboard bb, int count = 1)
 {
     blob.ResetStates(fromIndex, count);
     blob.ResetRuntimeData(fromIndex, count);
     for (var i = fromIndex; i < fromIndex + count; i++)
     {
         var typeId = blob.GetTypeId(i);
         var ptr    = blob.GetRuntimeDataPtr(i);
         MetaNodeRegister.NODES[typeId].Reset.Invoke(ptr, i, blob, bb);
     }
 }
Esempio n. 6
0
        public static IEnumerable <ComponentType> GetAccessTypes(int index, INodeBlob blob)
        {
            var typeId = blob.GetTypeId(index);

            return(_ACCESS_TYPES[typeId](index, blob));
        }