当前位置: 首页>>代码示例>>C#>>正文


C# IntVector3.ToString方法代码示例

本文整理汇总了C#中IntVector3.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IntVector3.ToString方法的具体用法?C# IntVector3.ToString怎么用?C# IntVector3.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IntVector3的用法示例。


在下文中一共展示了IntVector3.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateChunk

        public virtual Chunk GenerateChunk(IntVector3 start, IntVector3 end, int lod = 1)
        {
            Debug.WriteLine("Generating Chunk at " + start.ToString());
            var chunk = new Chunk(start, end);
            var pos = new IntVector3(start);

            for (pos.X = chunk.Start.X; pos.X < chunk.End.X; pos.X += lod)
                for (pos.Y = chunk.Start.Y; pos.Y < chunk.End.Y; pos.Y += lod)
                    for (pos.Z = chunk.Start.Z; pos.Z < chunk.End.Z; pos.Z += lod)
                        chunk.SetVoxel(pos, GenerateVoxel(pos));

            return chunk;
        }
开发者ID:TehWardy,项目名称:Framework,代码行数:13,代码来源:BaseGenerator.cs

示例2: getPatternOrChunk

        /// <summary>
        /// NOT FULLY IMPLEMENTED
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public patternOrChunk getPatternOrChunk(IntVector3 position)
        {
            patternOrChunk toMake;


            //map first
            if ((position >= mapOffset) && position < mapOffset + new IntVector3(mapSize))
            {
                Chunk possible = map.get(position - mapOffset);
                if (possible != null)
                {
                    toMake = new patternOrChunk(possible);
                    if (mapGenHelper != null)
                    {
                        mapGenHelper[position] = toMake;
                    }
                    return toMake;
                }
            }

            //then helper
            //because if you do helper first, then ones generated during a run don't get acknowledged
            if (mapGenHelper != null)
            {
                if (mapGenHelper.ContainsKey(position))
                {
                    return mapGenHelper[position];
                }
            }

            //then, check for a file
            String filename = position.ToString();
            mapV1 mapmaker;
            try
            {
                //for some reason this is slow as fuck
                //probably because hard drives are slow
                //so it's commented for now
                //I wonder if it would be better if it was actually loading things?
                //mapmaker = content.Load<mapV1>(filename);
            }
            catch (ContentLoadException)
            {
                //if no file, then generate the pattern
                //mapmaker = Mapgen.generatePatterns(this, position);
            }
            //beyond here lies TEMP SHIT CODE

            //if (mapmaker.layers[0] == "ungenerated")
            {
                toMake = new patternOrChunk(OutpostLibrary.Structure.field);
                if (mapGenHelper != null)
                {
                    mapGenHelper[position] = toMake;
                }
                return toMake;
            }
            Chunk building = new Chunk(position, graphics);

            //chunk loading from file goes here

            building.endFill();
            toMake = new patternOrChunk(building);
            if (mapGenHelper != null)
            {
                mapGenHelper[position] = toMake;
            }
            return toMake;
        }
开发者ID:littlebeast,项目名称:Outpost,代码行数:74,代码来源:MainGame.cs

示例3: loadChunk

        /// <summary>
        /// NOT FULLY IMPLEMENTED
        /// Loads a chunk specified by position in the world map.
        /// Will generate the chunk if it does not already exist.
        /// </summary>
        /// <param name="position">The position to load from.</param>
        /// <returns>An Octree representation of the chunk.</returns>
        Chunk loadChunk(IntVector3 position)
        {
            LoadingScreen.ChangeMessage("Loading chunk " + position.ToString());
            String filename = position.ToString();
            mapV1 mapmaker;
            try
            {
                //mapmaker = content.Load<mapV1>(filename);
            }
            catch (ContentLoadException)
            {
                //mapmaker = Mapgen.generatePatterns(this, position);
            }
            Chunk building = new Chunk(position, graphics);
            //if (mapmaker.layers[0] == "ungenerated")
            {

                lua.buildChunk(position, building);
            }
            //else
            {
                //Chunk loading from file code goes here.
            }
            return building;
        }
开发者ID:littlebeast,项目名称:Outpost,代码行数:32,代码来源:MainGame.cs


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