• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MyStorageDataTypeFlags类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MyStorageDataTypeFlags的典型用法代码示例。如果您正苦于以下问题:C# MyStorageDataTypeFlags类的具体用法?C# MyStorageDataTypeFlags怎么用?C# MyStorageDataTypeFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MyStorageDataTypeFlags类属于命名空间,在下文中一共展示了MyStorageDataTypeFlags类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ReadRange

        void ModAPI.Interfaces.IMyStorage.ReadRange(MyStorageDataCache target, MyStorageDataTypeFlags dataToRead, int lodIndex,  Vector3I lodVoxelRangeMin,  Vector3I lodVoxelRangeMax)
        {
            if ((uint)lodIndex >= (uint)MyCellCoord.MAX_LOD_COUNT)
                return;

            ReadRange(target, dataToRead, lodIndex, ref lodVoxelRangeMin, ref lodVoxelRangeMax);
        }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:7,代码来源:MyStorageBase_ModAPI.cs


示例2: ReadRange

        void VRage.ModAPI.IMyStorage.ReadRange(MyStorageData target, MyStorageDataTypeFlags dataToRead, int lodIndex, Vector3I lodVoxelRangeMin, Vector3I lodVoxelRangeMax, ref MyVoxelRequestFlags requestFlags)
        {
            if ((uint)lodIndex >= (uint)MyCellCoord.MAX_LOD_COUNT)
                return;

            ReadRange(target, dataToRead, lodIndex, ref lodVoxelRangeMin, ref lodVoxelRangeMax, ref requestFlags);
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:7,代码来源:MyStorageBase_ModAPI.cs


示例3: VoxelWriteOp

 public VoxelWriteOp(string voxelName, string data, MyStorageDataTypeFlags dataToWrite, Vector3I voxelRangeMin, Vector3I voxelRangeMax)
 {
     m_voxelName = voxelName;
     m_data = data;
     m_dataType = dataToWrite;
     m_voxelMin = voxelRangeMin;
     m_voxelMax = voxelRangeMax;
 }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:8,代码来源:MyVoxelPathfindingLog.cs


示例4: OnRangeChanged

 protected internal void OnRangeChanged(Vector3I voxelRangeMin, Vector3I voxelRangeMax, MyStorageDataTypeFlags changedData)
 {
     if (RangeChanged != null)
     {
         m_compressedData = null;
         this.ClampVoxelCoord(ref voxelRangeMin);
         this.ClampVoxelCoord(ref voxelRangeMax);
         RangeChanged(voxelRangeMin, voxelRangeMax, changedData);
     }
 }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:10,代码来源:MyStorageBase.cs


示例5: OnStorageChanged

        public void OnStorageChanged(Vector3I minChanged, Vector3I maxChanged, MyStorageDataTypeFlags dataChanged)
        {
            ProfilerShort.Begin("MyVoxelMap::storage_RangeChanged");

            minChanged = Vector3I.Clamp(minChanged, m_storageMin, m_storageMax);
            maxChanged = Vector3I.Clamp(maxChanged, m_storageMin, m_storageMax);
            Debug.Assert(minChanged.IsInsideInclusive(ref m_storageMin, ref m_storageMax) &&
                maxChanged.IsInsideInclusive(ref m_storageMin, ref m_storageMax));

            // Physics doesn't care about materials, just shape of things.
            if ((dataChanged & MyStorageDataTypeFlags.Content) != 0 &&
                Physics != null)
            {
                Physics.InvalidateRange(minChanged, maxChanged);
            }

            ProfilerShort.End();
        }
开发者ID:austusross,项目名称:SpaceEngineers,代码行数:18,代码来源:MyVoxelPhysics.cs


示例6: AssertRangeIsInside

        void IMyOctreeLeafNode.ReadRange(MyStorageData target, MyStorageDataTypeFlags types, ref Vector3I writeOffset, int lodIndex, ref Vector3I minInLod, ref Vector3I maxInLod, ref MyVoxelRequestFlags flags)
        {
            var lodShift = m_cell.Lod - lodIndex;
            var leafMinInLod = m_cell.CoordInLod << lodShift;
            var min = minInLod + leafMinInLod;
            var max = maxInLod + leafMinInLod;
            AssertRangeIsInside(lodIndex, ref min, ref max);
            ProfilerShort.Begin("MyProviderLeaf.ReadRange");
            MyVoxelDataRequest req = new MyVoxelDataRequest() {
                Target = target,
                Offset = writeOffset,
                Lod = lodIndex,
                minInLod = min,
                maxInLod = max,
                RequestFlags = flags,
                RequestedData = types
            };

            m_provider.ReadRange(ref req);
            flags = req.Flags;
            ProfilerShort.End();
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:22,代码来源:MyProviderLeaf.cs


示例7: Voxelize

        /// <summary>
        /// For debugging/testing only! This can be very slow for large storage.
        /// </summary>
        public void Voxelize(MyStorageDataTypeFlags data)
        {
            var cache = new MyStorageDataCache();

            cache.Resize(new Vector3I(LeafSizeInVoxels));
            var leafCount = (Size / LeafSizeInVoxels);
            Vector3I leaf = Vector3I.Zero;
            var end = leafCount - 1;
            for (var it = new Vector3I.RangeIterator(ref Vector3I.Zero, ref end);
                it.IsValid();
                it.GetNext(out leaf))
            {
                Debug.WriteLine("Processing {0} / {1}", leaf, end);
                var min = leaf * LeafSizeInVoxels;
                var max = min + (LeafSizeInVoxels - 1);
                ReadRangeInternal(cache, ref Vector3I.Zero, data, 0, ref min, ref max);
                WriteRangeInternal(cache, data, ref min, ref max);
            }

            OnRangeChanged(Vector3I.Zero, Size - 1, data);
        }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:24,代码来源:MyOctreeStorage.cs


示例8: WriteRangeInternal

 protected abstract void WriteRangeInternal(MyStorageData source, MyStorageDataTypeFlags dataToWrite, ref Vector3I voxelRangeMin, ref Vector3I voxelRangeMax);
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:1,代码来源:MyStorageBase.cs


示例9: ReadRangeInternal

 protected abstract void ReadRangeInternal(MyStorageData target, ref Vector3I targetWriteRange, MyStorageDataTypeFlags dataToRead, int lodIndex, ref Vector3I lodVoxelRangeMin, ref Vector3I lodVoxelRangeMax, ref MyVoxelRequestFlags requestFlags);
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:1,代码来源:MyStorageBase.cs


示例10: WriteRange

 void VRage.ModAPI.IMyStorage.WriteRange(MyStorageData source, MyStorageDataTypeFlags dataToWrite, Vector3I voxelRangeMin, Vector3I voxelRangeMax)
 {
     WriteRange(source, dataToWrite, ref voxelRangeMin, ref voxelRangeMax);
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:4,代码来源:MyStorageBase_ModAPI.cs


示例11: ResetInternal

 protected abstract void ResetInternal(MyStorageDataTypeFlags dataToReset);
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:1,代码来源:MyStorageBase.cs


示例12: ReadLod

            public void ReadLod(MyStorageData target, MyStorageDataTypeFlags dataTypes, ref Vector3I targetOffset, int lodIndex, ref Vector3I min, ref Vector3I max)
            {
                Debug.Assert(min.IsInsideInclusive(Vector3I.Zero, MaxVector >> lodIndex)
                    && max.IsInsideInclusive(Vector3I.Zero, MaxVector >> lodIndex));

                //using (Lock.AcquireSharedUsing())
                {
                    if (lodIndex > MaxLod)
                        UpdateLodData(lodIndex);

                    if (dataTypes.Requests(MyStorageDataTypeEnum.Content))
                    {
                        ReadLod(target, MyStorageDataTypeEnum.Content, Content, targetOffset, lodIndex, min, max);
                    }

                    if (dataTypes.Requests(MyStorageDataTypeEnum.Material))
                    {
                        ReadLod(target, MyStorageDataTypeEnum.Material, Material, targetOffset, lodIndex, min, max);
                    }
                }

                HitCount++;
            }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:23,代码来源:MyStorageBase.Cache.cs


示例13: GetChunk

        private void GetChunk(ref Vector3I coord, out VoxelChunk chunk, MyStorageDataTypeFlags required)
        {
            using (m_cacheLock.AcquireExclusiveUsing())
            {
                if (!m_cachedChunks.TryGetValue(coord, out chunk))
                {
                    chunk = new VoxelChunk(coord);

                    var rangeStart = coord << VoxelChunk.SizeBits;
                    var rangeEnd = ((coord + 1) << VoxelChunk.SizeBits) - 1;

                    if (required != 0)
                    {
                        using (m_storageLock.AcquireSharedUsing())
                            ReadDatForChunk(chunk, required);
                    }

                    m_chunksbyAge.Enqueue(coord);
                    m_cachedChunks.Add(coord, chunk);

                    var bb = new BoundingBox(rangeStart, rangeEnd);

                    chunk.TreeProxy = m_cacheMap.AddProxy(ref bb, chunk, 0);
                }
                else if ((chunk.Cached & required) != required)
                {
                    using (m_storageLock.AcquireSharedUsing())
                        ReadDatForChunk(chunk, required & ~chunk.Cached);
                }

            }
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:32,代码来源:MyStorageBase.Cache.cs


示例14: storage_RangeChangedPlanet

        private void storage_RangeChangedPlanet(Vector3I minChanged, Vector3I maxChanged, MyStorageDataTypeFlags dataChanged)
        {
            ProfilerShort.Begin("MyVoxelMap::storage_RangeChanged");
            Vector3I minSector = minChanged / PHYSICS_SECTOR_SIZE_METERS;
            Vector3I maxSector = maxChanged/PHYSICS_SECTOR_SIZE_METERS;

            Vector3I increment = m_storage.Size / (m_numCells+1);
            for (var it = new Vector3I.RangeIterator(ref minSector, ref maxSector);
                it.IsValid(); it.MoveNext())
            {
                MyVoxelPhysics voxelMap = CreatePhysicsShape(ref increment, ref it);

                voxelMap.OnStorageChanged(minChanged, maxChanged, dataChanged);
            }

            if (Render is MyRenderComponentVoxelMap)
            {
                (Render as MyRenderComponentVoxelMap).InvalidateRange(minChanged, maxChanged);
            }

            ProfilerShort.End();
        }
开发者ID:notten,项目名称:SpaceEngineers,代码行数:22,代码来源:MyPlanet.cs


示例15: storage_RangeChanged

        /// <param name="minVoxelChanged">Inclusive min.</param>
        /// <param name="maxVoxelChanged">Inclusive max.</param>
        private void storage_RangeChanged(Vector3I minChanged, Vector3I maxChanged, MyStorageDataTypeFlags changedData)
        {
            MyPrecalcComponent.AssertUpdateThread();

            ProfilerShort.Begin("MyVoxelGeometry.storage_RangeChanged");

            minChanged -= MyPrecalcComponent.InvalidatedRangeInflate;
            maxChanged += MyPrecalcComponent.InvalidatedRangeInflate;
            m_storage.ClampVoxelCoord(ref minChanged);
            m_storage.ClampVoxelCoord(ref maxChanged);
            var minCellChanged = minChanged >> MyVoxelConstants.GEOMETRY_CELL_SIZE_IN_VOXELS_BITS;
            var maxCellChanged = maxChanged >> MyVoxelConstants.GEOMETRY_CELL_SIZE_IN_VOXELS_BITS;
            using (m_lock.AcquireExclusiveUsing())
            {
                if (minCellChanged == Vector3I.Zero && maxCellChanged == m_cellsCount - 1)
                {
                    m_cellsByCoordinate.Clear();
                    m_coordinateToMesh.Clear();
                    m_isEmptyCache.Reset();
                }
                else
                {
                    MyCellCoord cell = new MyCellCoord();
                    cell.CoordInLod = minCellChanged;
                    for (var it = new Vector3I_RangeIterator(ref minCellChanged, ref maxCellChanged); it.IsValid(); it.GetNext(out cell.CoordInLod))
                    {
                        var key = cell.PackId64();
                        m_cellsByCoordinate.Remove(key);
                        m_coordinateToMesh.Remove(key);
                        SetEmpty(ref cell, false);
                    }
                }
            }

            ProfilerShort.End();
        }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:38,代码来源:MyVoxelGeometry.cs


示例16: ReadContentRange

 void IMyStorageDataProvider.ReadRange(MyStorageData target, MyStorageDataTypeFlags dataType, ref Vector3I writeOffset, int lodIndex, ref Vector3I minInLod, ref Vector3I maxInLod)
 {
     if (dataType.Requests(MyStorageDataTypeEnum.Content))
         ReadContentRange(target, ref writeOffset, lodIndex, ref minInLod, ref maxInLod);
     else
         ReadMaterialRange(target, ref writeOffset, lodIndex, ref minInLod, ref maxInLod);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:7,代码来源:MyCompositeShapeProvider.cs


示例17: WriteRangeInternal

        protected override void WriteRangeInternal(MyStorageDataCache source, MyStorageDataTypeFlags dataToWrite, ref Vector3I voxelRangeMin, ref Vector3I voxelRangeMax)
        {
            ProfilerShort.Begin("MyOctreeStorage.WriteRange");

            Debug.Assert(dataToWrite != MyStorageDataTypeFlags.None);
            if ((dataToWrite & MyStorageDataTypeFlags.Content) != 0)
            {
                var args = new WriteRangeArgs()
                {
                    DataFilter = MyOctreeNode.ContentFilter,
                    DataType = MyStorageDataTypeEnum.Content,
                    Leaves = m_contentLeaves,
                    Nodes = m_contentNodes,
                    Provider = m_dataProvider,
                    Source = source,
                };
                WriteRange(ref args, 0, m_treeHeight + LeafLodCount, Vector3I.Zero, ref voxelRangeMin, ref voxelRangeMax);
            }

            if ((dataToWrite & MyStorageDataTypeFlags.Material) != 0)
            {
                var args = new WriteRangeArgs()
                {
                    DataFilter = MyOctreeNode.MaterialFilter,
                    DataType = MyStorageDataTypeEnum.Material,
                    Leaves = m_materialLeaves,
                    Nodes = m_materialNodes,
                    Provider = m_dataProvider,
                    Source = source,
                };
                WriteRange(ref args, 0, m_treeHeight + LeafLodCount, Vector3I.Zero, ref voxelRangeMin, ref voxelRangeMax);
            }

            ProfilerShort.End();
        }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:35,代码来源:MyOctreeStorage.cs


示例18: ReadRangeInternal

        protected override void ReadRangeInternal(MyStorageDataCache target, ref Vector3I targetWriteOffset,
            MyStorageDataTypeFlags dataToRead, int lodIndex, ref Vector3I lodVoxelCoordStart, ref Vector3I lodVoxelCoordEnd)
        {
            bool hasLod = lodIndex <= (m_treeHeight + LeafLodCount);
            Debug.Assert(dataToRead != MyStorageDataTypeFlags.None);
            if ((dataToRead & MyStorageDataTypeFlags.Content) != 0)
            {
                if (hasLod)
                {
                    ReadRange(target, ref targetWriteOffset, MyStorageDataTypeEnum.Content, m_treeHeight, m_contentNodes, m_contentLeaves, lodIndex, ref lodVoxelCoordStart, ref lodVoxelCoordEnd);
                }
            }

            if ((dataToRead & MyStorageDataTypeFlags.Material) != 0)
            {
                if (hasLod)
                {
                    ReadRange(target, ref targetWriteOffset, MyStorageDataTypeEnum.Material, m_treeHeight, m_materialNodes, m_materialLeaves, lodIndex, ref lodVoxelCoordStart, ref lodVoxelCoordEnd);
                }
            }
        }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:21,代码来源:MyOctreeStorage.cs


示例19: ResetInternal

        protected override void ResetInternal(MyStorageDataTypeFlags dataToReset)
        {
            bool resetContent = (dataToReset & MyStorageDataTypeFlags.Content) != 0;
            bool resetMaterials = (dataToReset & MyStorageDataTypeFlags.Material) != 0;

            if (resetContent)
            {
                m_contentLeaves.Clear();
                m_contentNodes.Clear();
            }

            if (resetMaterials)
            {
                m_materialLeaves.Clear();
                m_materialNodes.Clear();
            }

            if (m_dataProvider != null)
            {
                var cellCoord = new MyCellCoord(m_treeHeight, ref Vector3I.Zero);
                var leafId = cellCoord.PackId64();
                cellCoord.Lod += LeafLodCount;
                var end = Size - 1;
                if (resetContent)
                {
                    m_contentLeaves.Add(leafId,
                        new MyProviderLeaf(m_dataProvider, MyStorageDataTypeEnum.Content, ref cellCoord));
                }
                if (resetMaterials)
                {
                    m_materialLeaves.Add(leafId,
                        new MyProviderLeaf(m_dataProvider, MyStorageDataTypeEnum.Material, ref cellCoord));
                }
            }
            else
            {
                var nodeId = new MyCellCoord(m_treeHeight - 1, ref Vector3I.Zero).PackId64();
                if (resetContent)
                {
                    m_contentNodes.Add(nodeId, new MyOctreeNode());
                }
                if (resetMaterials)
                {
                    m_materialNodes.Add(nodeId, new MyOctreeNode());
                }
            }
        }
开发者ID:Krulac,项目名称:SpaceEngineers,代码行数:47,代码来源:MyOctreeStorage.cs


示例20: OnRangeChanged

 protected internal void OnRangeChanged(Vector3I voxelRangeMin, Vector3I voxelRangeMax, MyStorageDataTypeFlags changedData)
 {
     if (RangeChanged != null)
     {
         RangeChanged(this, voxelRangeMin, voxelRangeMax, changedData);
     }
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:7,代码来源:MyVoxelBase.cs



注:本文中的MyStorageDataTypeFlags类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MyStringHash类代码示例发布时间:2022-05-24
下一篇:
C# MySqlDbType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap