Exemplo n.º 1
0
            static bool match(World world, ref SmallList <EntityQueryPart> queryParts, string entityPath)
            {
                var pathParts = new EntityQuery(entityPath).EnumerateParts();
                ReadOnlySpan <EntityQueryPart> remainingQueryParts = queryParts.AsSpan();
                bool matches = false;

                foreach (EntityQueryPart pathPart in pathParts)
                {
                    if (remainingQueryParts.IsEmpty)
                    {
                        return(false);
                    }
                    EntityQueryPart queryPart = remainingQueryParts[0];
                    if (!queryPart.SearchInAliases && !matchParts(queryPart, pathPart))
                    {
                        return(false);
                    }
                    if (queryPart.SearchInAliases && queryPart.IsLast)
                    {
                        var path = new EntityPath(queryPart.Value.ToString());
                        return(world._aliases.TryGetValue(path, out EntityId id) &&
                               id.Path.Equals(entityPath, StringComparison.Ordinal));
                    }

                    remainingQueryParts = remainingQueryParts[1..];
Exemplo n.º 2
0
 public void Dispose()
 {
     if (Children is not null)
     {
         foreach (VfsNode node in Children.Values)
         {
             node.Dispose();
         }
     }
     foreach (ArchiveFile mountedArchive in MountedArchives.AsSpan())
     {
         mountedArchive.Dispose();
     }
 }