Exemplo n.º 1
0
 void Start()
 {
     velocity = new List<Vector3>();
     angular = new List<Vector3>();
     foreach(Rigidbody r in pauseing)
     {
         velocity.Add(r.velocity);
         angular.Add(r.angularVelocity);
     }
     needsATrim = false;
     nil = isNull;
     gNil = isGNull;
 }
        private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            if (snippets == null)
            {
                return;
            }

            var path = GetSnippetsPath();

            if (path == null)
            {
                return;
            }

            System.Predicate <string> snippet = x => x.StartsWith(path, System.StringComparison.OrdinalIgnoreCase);

            if (System.Array.Exists(importedAssets, snippet) ||
                System.Array.Exists(deletedAssets, snippet) ||
                System.Array.Exists(movedAssets, snippet) ||
                System.Array.Exists(movedFromAssetPaths, snippet))
            {
                Reload();
            }
        }
        static int _m_TrueForAll(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                System.Collections.Generic.List <int> gen_to_be_invoked = (System.Collections.Generic.List <int>)translator.FastGetCSObj(L, 1);



                {
                    System.Predicate <int> _match = translator.GetDelegate <System.Predicate <int> >(L, 2);

                    bool gen_ret = gen_to_be_invoked.TrueForAll(_match);
                    LuaAPI.lua_pushboolean(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static StackObject *FindAll_6(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Predicate <ILRuntime.Runtime.Intepreter.ILTypeInstance> @match = (System.Predicate <ILRuntime.Runtime.Intepreter.ILTypeInstance>) typeof(System.Predicate <ILRuntime.Runtime.Intepreter.ILTypeInstance>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 8);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List <ILRuntime.Runtime.Intepreter.ILTypeInstance> instance_of_this_method = (System.Collections.Generic.List <ILRuntime.Runtime.Intepreter.ILTypeInstance>) typeof(System.Collections.Generic.List <ILRuntime.Runtime.Intepreter.ILTypeInstance>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.FindAll(@match);

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemplo n.º 5
0
    // ?꾩씠??李얘린.
    public List <ItemController> findItems(System.Predicate <ItemController> pred)
    {
        GameObject[] gos = GameObject.FindGameObjectsWithTag("Item");

        List <ItemController> items = new List <ItemController>();

        foreach (var go in gos)
        {
            var controller = go.GetComponent <ItemController>();

            if (controller == null)
            {
                continue;
            }
            if (!pred(controller))
            {
                continue;
            }

            items.Add(go.GetComponent <ItemController>());
        }

        return(items);
    }
Exemplo n.º 6
0
        public override bool Drop(BasePlayerItem dropOnItem)
        {
            bool result;

            if ((ulong)dropOnItem.Template.TypeId != (ulong)((long)base.LivingObjectRecord.ItemType))
            {
                result = false;
            }
            else
            {
                if (dropOnItem.Effects.Any((EffectBase x) => x.EffectId == EffectsEnum.Effect_LivingObjectId))
                {
                    result = false;
                }
                else
                {
                    dropOnItem.Effects.Add(new EffectInteger(EffectsEnum.Effect_LivingObjectId, (short)this.Template.Id));
                    using (System.Collections.Generic.List <EffectBase> .Enumerator enumerator = this.Effects.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            EffectBase effect = enumerator.Current;
                            System.Collections.Generic.List <EffectBase> arg_B1_0 = dropOnItem.Effects;
                            System.Predicate <EffectBase> match = (EffectBase x) => x.EffectId == effect.EffectId;
                            arg_B1_0.RemoveAll(match);
                            dropOnItem.Effects.Add(effect);
                        }
                    }
                    base.Owner.Inventory.RefreshItemInstance(dropOnItem);
                    base.Owner.UpdateLook(true);
                    base.OnObjectModified();
                    result = true;
                }
            }
            return(result);
        }
Exemplo n.º 7
0
        public T GetOrCreateAsset <T>(System.Predicate <T> predicate,
                                      string name,
                                      System.Action <T> onFirstRef)
            where T : ScriptableObject
        {
            if (predicate == null)
            {
                throw new System.ArgumentNullException("predicate");
            }

            var assets = GetAssets <T>();
            T   alreadyCreatedAsset = null;

            foreach (var asset in assets)
            {
                if (predicate(asset))
                {
                    alreadyCreatedAsset = asset;
                    break;
                }
            }

            return(GetOrCreateAsset(alreadyCreatedAsset, name, onFirstRef));
        }
Exemplo n.º 8
0
 public virtual bool HasClaim(System.Predicate <System.Security.Claims.Claim> match)
 {
     throw null;
 }
Exemplo n.º 9
0
 public virtual System.Collections.Generic.IEnumerable <System.Security.Claims.Claim> FindAll(System.Predicate <System.Security.Claims.Claim> match)
 {
     throw null;
 }
Exemplo n.º 10
0
 public bool TryReceive(System.Predicate <T>?filter, [System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] out T item)
 {
     throw null;
 }
Exemplo n.º 11
0
 public static System.IDisposable LinkTo <TOutput>(this System.Threading.Tasks.Dataflow.ISourceBlock <TOutput> source, System.Threading.Tasks.Dataflow.ITargetBlock <TOutput> target, System.Threading.Tasks.Dataflow.DataflowLinkOptions linkOptions, System.Predicate <TOutput> predicate)
 {
     throw null;
 }
Exemplo n.º 12
0
 public bool TryReceive(System.Predicate <T[]>?filter, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T[]?item)
 {
     throw null;
 }
Exemplo n.º 13
0
 public static bool ForAll(int fromInclusive, int toExclusive, System.Predicate <int> predicate)
 {
     throw null;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Removes all tags that match the given predicate.
 /// </summary>
 /// <param name="predicate"></param>
 public override void RemoveAll(System.Predicate <Tag> predicate)
 {
     _tagsList.RemoveAll(x => predicate.Invoke(new Tag(_stringTable.Get(x.Key), _stringTable.Get(x.Value))));
 }
Exemplo n.º 15
0
 internal ControllingIndexProviderFactory(IDictionary <GraphDatabaseService, IndexProvider> perDbIndexProvider, System.Predicate <GraphDatabaseService> injectLatchPredicate) : base(ExtensionType.DATABASE, _controlledProviderDescriptor.Key)
 {
     this.PerDbIndexProvider   = perDbIndexProvider;
     this.InjectLatchPredicate = injectLatchPredicate;
 }
        /// <summary>
        /// Init SpriteAnimation internal state.
        /// </summary>
        public void Init()
        {
            playingQueueChecker = new System.Predicate<SpriteAnimationState>(checkPlayingQueue);
            crossFadeQueueChecker = new System.Predicate<SpriteAnimationQueueItem>(checkCrossFadeQueue);
            removeAllClip = new System.Predicate<SpriteAnimationState>(removeClip);

            if ( Application.isPlaying && _isInit)
                return;


            spriteRenderer = GetComponent<SpriteRenderer>();
            //spriteRenderer.Clear();

            resetClip();

            _isInit = true;
        }
Exemplo n.º 17
0
 public override IFigure HitTest(System.Windows.Point point, System.Predicate <IFigure> filter)
 {
     return(null);
 }
Exemplo n.º 18
0
 internal ControlledGraphDatabaseFactory(System.Predicate <GraphDatabaseService> dbsToControlIndexingOn)
 {
     Factory = new ControllingIndexProviderFactory(PerDbIndexProvider, dbsToControlIndexingOn);
     CurrentState.removeKernelExtensions(kef => kef.GetType().Name.Contains("IndexProvider"));
     CurrentState.addKernelExtensions(Collections.singletonList(Factory));
 }
Exemplo n.º 19
0
 public override Component Find(System.Predicate <Component> Predicate)
 {
     return(World.Find(Predicate));
 }
Exemplo n.º 20
0
 internal ParameterTypeVisitor(Types typeUtils, TypeMirrorUtils typeMirrors)
 {
     _allowedTypesValidator = new AllowedTypesValidator(typeMirrors, typeUtils);
 }
Exemplo n.º 21
0
 public static bool ForAll <T>(System.Collections.Generic.IEnumerable <T> collection, System.Predicate <T> predicate)
 {
     throw null;
 }
        public static Component SelectComponentFromSourceField(GUIContent label, GameObject source, Component selectedComp, System.Predicate <Component> filter = null)
        {
            var position = EditorGUILayout.GetControlRect(true);

            return(SPEditorGUI.SelectComponentFromSourceField(position, label, source, selectedComp, filter));
        }
Exemplo n.º 23
0
 public bool TryReceive(System.Predicate <System.Tuple <System.Collections.Generic.IList <T1>, System.Collections.Generic.IList <T2> > >?filter, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Tuple <System.Collections.Generic.IList <T1>, System.Collections.Generic.IList <T2> >?item)
 {
     throw null;
 }
Exemplo n.º 24
0
 public static void Foreach <T>(System.Predicate <T> call, int mask = 0, bool includeInactive = false) where T : Collider_
 {
     instance._Foreach(call, mask, includeInactive);
 }
Exemplo n.º 25
0
 public bool TryReceive(System.Predicate <System.Tuple <T1, T2> >?filter, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out System.Tuple <T1, T2>?item)
 {
     throw null;
 }
Exemplo n.º 26
0
 /// <summary>
 /// Removes all tags that match the given criteria.
 /// </summary>
 /// <param name="predicate"></param>
 public abstract void RemoveAll(System.Predicate <Tag> predicate);
Exemplo n.º 27
0
 public T Find(System.Predicate <T> Predicate)
 {
     return(_points.Find(Predicate));
 }
Exemplo n.º 28
0
        // create a terrain map of ALL terrains, by using only their placement to fit them to a grid
        // the position and size of originTerrain defines the grid alignment and origin.  if NULL, we use the first active terrain
        static public TerrainMap CreateFromPlacement(Vector2 gridOrigin, Vector2 gridSize, System.Predicate <Terrain> filter = null, bool fullValidation = true)
        {
            if ((Terrain.activeTerrains == null) || (Terrain.activeTerrains.Length == 0))
            {
                return(null);
            }

            TerrainMap terrainMap = new TerrainMap();

            float gridScaleX = 1.0f / gridSize.x;
            float gridScaleZ = 1.0f / gridSize.y;

            // iterate all active terrains
            foreach (Terrain terrain in Terrain.activeTerrains)
            {
                // some integration tests just create a terrain component without terrain data
                if (terrain.terrainData == null)
                {
                    continue;
                }

                if ((filter == null) || filter(terrain))
                {
                    // convert position to a grid index, with proper rounding
                    Vector3 pos   = terrain.transform.position;
                    int     tileX = Mathf.RoundToInt((pos.x - gridOrigin.x) * gridScaleX);
                    int     tileZ = Mathf.RoundToInt((pos.z - gridOrigin.y) * gridScaleZ);
                    // attempt to add the terrain at that grid position
                    terrainMap.TryToAddTerrain(tileX, tileZ, terrain);
                }
            }

            // run validation to check alignment status
            if (fullValidation)
            {
                terrainMap.Validate();
            }

            return((terrainMap.m_terrainTiles.Count > 0) ? terrainMap : null);
        }
Exemplo n.º 29
0
 public virtual System.Security.Claims.Claim FindFirst(System.Predicate <System.Security.Claims.Claim> match)
 {
     throw null;
 }
Exemplo n.º 30
0
        static public TerrainMap CreateFromConnectedNeighbors(Terrain originTerrain, System.Predicate <Terrain> filter = null, bool fullValidation = true)
        {
            if (originTerrain == null)
            {
                return(null);
            }

            if (originTerrain.terrainData == null)
            {
                return(null);
            }

            TerrainMap terrainMap = new TerrainMap();

            Queue <QueueElement> todoQueue = new Queue <QueueElement>();

            todoQueue.Enqueue(new QueueElement(0, 0, originTerrain));

            int maxTerrains = Terrain.activeTerrains.Length;

            while (todoQueue.Count > 0)
            {
                QueueElement cur = todoQueue.Dequeue();
                if ((filter == null) || filter(cur.terrain))
                {
                    if (terrainMap.TryToAddTerrain(cur.tileX, cur.tileZ, cur.terrain))
                    {
                        // sanity check to stop bad neighbors causing infinite iteration
                        if (terrainMap.m_terrainTiles.Count > maxTerrains)
                        {
                            break;
                        }

                        if (cur.terrain.leftNeighbor != null)
                        {
                            todoQueue.Enqueue(new QueueElement(cur.tileX - 1, cur.tileZ, cur.terrain.leftNeighbor));
                        }
                        if (cur.terrain.bottomNeighbor != null)
                        {
                            todoQueue.Enqueue(new QueueElement(cur.tileX, cur.tileZ - 1, cur.terrain.bottomNeighbor));
                        }
                        if (cur.terrain.rightNeighbor != null)
                        {
                            todoQueue.Enqueue(new QueueElement(cur.tileX + 1, cur.tileZ, cur.terrain.rightNeighbor));
                        }
                        if (cur.terrain.topNeighbor != null)
                        {
                            todoQueue.Enqueue(new QueueElement(cur.tileX, cur.tileZ + 1, cur.terrain.topNeighbor));
                        }
                    }
                }
            }

            // run validation to check alignment status
            if (fullValidation)
            {
                terrainMap.Validate();
            }

            return(terrainMap);
        }
Exemplo n.º 31
0
 public virtual TItem Find(System.Predicate <TItem> match)
 {
     return(items.Find(match));
 }
Exemplo n.º 32
0
 public virtual TestGraphDatabaseFactory RemoveKernelExtensions <T1>(System.Predicate <T1> filter)
 {
     CurrentState.removeKernelExtensions(filter);
     return(this);
 }