コード例 #1
0
ファイル: Test05.cs プロジェクト: GraphicGame/CSLightStudio
    public static void Run()
    {
        if (c5 == null)
        {
            c5 = new C5();

        }
        try
        {

            throw new NotImplementedException("E2");
        }
        catch (NotSupportedException err)
        {
            Debug.Log("not here.");
        }
        catch (NotImplementedException err)
        {
            Debug.Log("Got.");
        }
        catch (Exception err)
        {
            Debug.Log("Got 2.");
        }
    }
コード例 #2
0
ファイル: Obstacle.cs プロジェクト: jgera/AutonomousCar
        public CompositeObstacle(C5.ICollection<Obstacle> obstacles)
        {
            Bodies = new LinkedList<Body>();

            foreach (Obstacle o in obstacles)
                Bodies.Add(o.Body);
        }
コード例 #3
0
ファイル: Customer.cs プロジェクト: sundowndk/Allectus
        public Customer(C5.Debitor Debitor)
        {
            this._id = Guid.NewGuid ();
            this._createtimestamp = SNDK.Date.CurrentDateTimeToTimestamp ();
            this._updatetimestamp = SNDK.Date.CurrentDateTimeToTimestamp ();
            this._erpid = string.Empty;

            this._c5debitor = Debitor;
        }
コード例 #4
0
    internal void CalculateNormal(C5.IPriorityQueue<CloudPoint> neighbors)
    {
        Vector avg = neighbors.Aggregate(new Vector(3), (sum, val) => sum + val.location) / (double)neighbors.Count;

        Matrix cov = ((double)1 / neighbors.Count) *
                            neighbors.Aggregate(new Matrix(3, 3),
                                                        (sum, val) => sum +
                                                                    (val.location - avg).ToColumnMatrix() *
                                                                    (val.location - avg).ToRowMatrix());

        // that dude says the smallest eigenvalue is the normal
        // first column of eigenvectors is the smallest eigenvalued one
        normal = cov.EigenVectors.GetColumnVector(0);

        // orient normal toward viewpoint

        // to do this we have to push the origin into the world frame
         //v = ZigInput.ConvertImageToWorldSpace(v);
        var viewp = ZigInput.ConvertImageToWorldSpace(Vector3.zero);

        normal = ((normal * (viewp.ToVector() - this.location)) > 0 ? normal : -normal);
        normal.Normalize();
    }
コード例 #5
0
        private void RecursiveCollectSubfoldersAndItems(UUID id, UUID ownerId, List<UUID> allFolders, List<UUID> allItems, C5.HashSet<UUID> rootItems, C5.HashSet<UUID> rootFolders, bool isRoot,
            Dictionary<Guid, InventoryFolderBase> index, StringBuilder debugFolderList)
        {
            if (index == null)
            {
                index = GetFolderIndex(ownerId);
            }

            InventoryFolderBase folder;
            try
            {
                folder = this.GetFolder(id);
            }
            catch (InventoryObjectMissingException)
            {
                //missing a folder is not a fatal exception, it could indicate a corrupted or temporarily
                //inconsistent inventory state. this should not stop the remainder of the collection
                _log.WarnFormat("[Inworldz.Data.Inventory.Cassandra] Found missing folder with subFolder index remaining in parent. Inventory may need subfolder index maintenance.");
                return;
            }
            catch (InventoryStorageException e)
            {
                if (e.InnerException != null && e.InnerException is KeyNotFoundException)
                {
                    //not a fatal exception, it could indicate a corrupted or temporarily
                    //inconsistent inventory state. this should not stop the remainder of the collection
                    _log.WarnFormat("[Inworldz.Data.Inventory.Cassandra] Found corrupt folder with subFolder index remaining in parent. User inventory needs subfolder index maintenance.");
                    return;
                }
                else
                {
                    throw;
                }
            }

            foreach (InventoryItemBase item in folder.Items)
            {
                allItems.Add(item.ID);

                if (isRoot)
                {
                    rootItems.Add(item.ID);
                }

                debugFolderList.AppendLine("I " + item.ID.ToString() + " " + item.Name);
            }

            foreach (InventoryNodeBase subFolder in folder.SubFolders)
            {
                if (subFolder.Owner != ownerId)
                {
                    throw new UnrecoverableInventoryStorageException(
                        String.Format("Changed owner found during recursive folder collection. Folder: {0}, Expected Owner: {1}, Found Owner: {2}",
                        subFolder.ID, ownerId, subFolder.Owner)); ;
                }


                if (SubfolderIsConsistent(subFolder.ID, folder.ID, index))
                {
                    debugFolderList.AppendLine("F " + subFolder.ID.ToString() + " " + subFolder.Name);

                    allFolders.Add(subFolder.ID);

                    if (isRoot)
                    {
                        rootFolders.Add(subFolder.ID);
                    }

                    this.RecursiveCollectSubfoldersAndItems(subFolder.ID, ownerId, allFolders, allItems, rootItems, rootFolders, false, index, debugFolderList);
                }
                else
                {
                    _log.WarnFormat("[Inworldz.Data.Inventory.Cassandra] Not recursing into folder {0} with parent {1}. Index is inconsistent", 
                        subFolder.ID, folder.ID);
                }
            }
        }
コード例 #6
0
ファイル: GameInformation.cs プロジェクト: druzil/nggp-base
 /**
  * @param rules The rules used by the game.
  */
 public void SetRules(C5.TreeDictionary<int, List<Implication>> rules)
 {
     _rules = rules;
 }
コード例 #7
0
ファイル: GameInformation.cs プロジェクト: druzil/nggp-base
 /**
  * @param relations The relations to set.
  */
 public void SetRelations(C5.TreeDictionary<int, RelationInfo> relations)
 {
     _relations = relations;
 }
コード例 #8
0
ファイル: GameInformation.cs プロジェクト: druzil/nggp-base
 /**
  * @param groundFacts The game's ground facts.
  */
 public void SetGroundFacts(C5.TreeDictionary<int, List<GroundFact>> groundFacts)
 {
     _groundFacts = groundFacts;
 }
コード例 #9
0
        private void CollectCreatedAssetIdsFromUserInventory(UUID creatorId, C5.HashSet<UUID> retAssets)
        {
            IInventoryProviderSelector selector = ProviderRegistry.Instance.Get<IInventoryProviderSelector>();
            IInventoryStorage provider = selector.GetProvider(creatorId);

            List<InventoryFolderBase> skel = provider.GetInventorySkeleton(creatorId);
            foreach (InventoryFolderBase folder in skel)
            {
                InventoryFolderBase fullFolder = provider.GetFolder(folder.ID);
                foreach (InventoryItemBase item in fullFolder.Items)
                {
                    if (m_allowedCreatorIds.Contains(item.CreatorIdAsUuid))
                    {
                        retAssets.Add(item.AssetID);
                    }
                }
            }
        }
コード例 #10
0
ファイル: InheritMap.cs プロジェクト: chinshou/Obfuscar
        void GetVirtualMethods( AssemblyCache cache, C5.TreeSet<MethodKey> methods, TypeDefinition type )
        {
            // check the interfaces
            foreach ( TypeReference ifaceRef in type.Interfaces )
            {
                TypeDefinition iface = project.GetTypeDefinition( ifaceRef );

                // if it's not in the project, try to get it via the cache
                if ( iface == null )
                    iface = cache.GetTypeDefinition( ifaceRef );

                // search interface
                if ( iface != null )
                    GetVirtualMethods( cache, methods, iface );
            }

            // check the base type unless it isn't in the project, or we don't have one
            TypeDefinition baseType = project.GetTypeDefinition( type.BaseType );

            // if it's not in the project, try to get it via the cache
            if ( baseType == null )
                baseType = cache.GetTypeDefinition( type.BaseType );

            // search base
            if ( baseType != null )
                GetVirtualMethods( cache, methods, baseType );

            foreach ( MethodDefinition method in type.Methods )
            {
                if ( method.IsVirtual )
                    methods.Add( new MethodKey( method ) );
            }
        }
コード例 #11
0
ファイル: InheritMap.cs プロジェクト: chinshou/Obfuscar
        void GetBaseTypes( C5.HashSet<TypeKey> baseTypes, TypeDefinition type )
        {
            // check the interfaces
            foreach ( TypeReference ifaceRef in type.Interfaces )
            {
                TypeDefinition iface = project.GetTypeDefinition( ifaceRef );
                if ( iface != null )
                {
                    GetBaseTypes( baseTypes, iface );
                    baseTypes.Add( new TypeKey( iface ) );
                }
            }

            // check the base type unless it isn't in the project, or we don't have one
            TypeDefinition baseType = project.GetTypeDefinition( type.BaseType );
            if ( baseType != null && baseType.FullName != "System.Object" )
            {
                GetBaseTypes( baseTypes, baseType );
                baseTypes.Add( new TypeKey( baseType ) );
            }
        }
コード例 #12
0
ファイル: DumpWriter.cs プロジェクト: goldshtn/minidumper
        private static bool HasIntervalThatIsSubsetOfInterval(
            C5.TreeDictionary<ulong, ulong> regions,
            ulong regionStart,
            ulong regionEnd)
        {
            // Is there any region in whose [start, end] interval is a sub-interval of
            // [regionStart, regionEnd]?
            // TryWeakSuccessor gives us the first region whose start is >= regionStart,
            // but there could be more regions with start >= regionStart and end <= regionEnd.
            // Need to traverse successors until start > regionEnd, making containment impossible.
            C5.KeyValuePair<ulong, ulong> range;
            if (regions.TryWeakSuccessor(regionStart, out range))
            {
                if (range.Key >= regionStart && range.Value <= regionEnd)
                    return true;
            }
            while (regions.TrySuccessor(range.Key, out range))
            {
                if (range.Key > regionEnd)
                    break;

                if (range.Key >= regionStart && range.Value <= regionEnd)
                    return true;
            }
            return false;
        }