コード例 #1
0
        /// <inheritdoc />
        public void Configure(IConfigSection configSection)
        {
            _maxCellSize = configSection.GetFloat("cell_size", 100);
            var maxArea = configSection.GetFloat("tri_area", 6);

            _meshCellBuilder.SetMaxArea(maxArea);
        }
コード例 #2
0
        /// <inheritdoc />
        public void Configure(IConfigSection configSection)
        {
            _tileSize        = configSection.GetFloat("size", 500);
            _offset          = configSection.GetFloat("offset", 50);
            _moveSensitivity = configSection.GetFloat("sensitivity", 10);

            var renderModeString = configSection.GetString("render_mode", "scene").ToLower();

            _renderMode = renderModeString == "scene" ? RenderMode.Scene : RenderMode.Overview;

            var viewportConfig = configSection.GetSection("viewport");
            var width          = viewportConfig != null?viewportConfig.GetFloat("w", 0) : 0;

            var height = viewportConfig != null?viewportConfig.GetFloat("h", 0) : 0;

            _viewport = new Rectangle2d(0, 0, width, height);

            RecalculateOverviewTileCount();

            _thresholdDistance = Math.Sqrt(2) * _tileSize;
        }
コード例 #3
0
        public void CanReadFloatValue()
        {
            var value = _stubSection.GetFloat("float", -1);

            Assert.IsTrue(Compare(5.12f, value));
        }
コード例 #4
0
 /// <inheritdoc />
 public void Configure(IConfigSection configSection)
 {
     _moveSensitivity = configSection.GetFloat("sensitivity", 30);
     _offsetRatio = configSection.GetFloat("offset", 10); // percentage of tile size
 }
コード例 #5
0
 /// <inheritdoc />
 public void Configure(IConfigSection configSection)
 {
     _moveSensitivity = configSection.GetFloat(@"tile/sensitivity", 30);
     _offsetRatio     = configSection.GetFloat(@"tile/offset", 10); // percentage of tile size
     _maxTileDistance = configSection.GetInt(@"tile/max_tile_distance", 2);
 }