NBToolkit.BlockFilter.BlockFilter C# (CSharp) Method

BlockFilter() public method

public BlockFilter ( ) : System
return System
        public BlockFilter()
        {
            _options = new OptionSet() {
                { "bxr|BlockXRange=", "Include blocks with X-coord between {0:V1} and {1:V2}, inclusive.  V1 or V2 may be left blank.",
                    (v1, v2) => {
                        try { _xAboveEq = Convert.ToInt32(v1); } catch (FormatException) { }
                        try { _xBelowEq = Convert.ToInt32(v2); } catch (FormatException) { }
                    } },
                { "byr|BlockYRange=", "Include blocks with Y-coord between {0:V1} and {1:V2}, inclusive.  V1 or V2 may be left blank.",
                    (v1, v2) => {
                        try { _yAboveEq = Convert.ToInt32(v1); } catch (FormatException) { }
                        try { _yBelowEq = Convert.ToInt32(v2); } catch (FormatException) { }
                    } },
                { "bzr|BlockZRange=", "Include blocks with Z-coord between {0:V1} and {1:V2}, inclusive.  V1 or V2 may be left blank.",
                    (v1, v2) => {
                        try { _zAboveEq = Convert.ToInt32(v1); } catch (FormatException) { }
                        try { _zBelowEq = Convert.ToInt32(v2); } catch (FormatException) { }
                    } },
                { "brv|BlockInvertXYZ", "Inverts the block selection created by --bxr, --byr and --bzr when all three options are used.",
                    v => _invertXYZ = true },
                { "bi|BlockInclude=", "Match blocks of type {ID}.  This option is repeatable.",
                    v => _includedBlocks.Add(Convert.ToInt32(v)) },
                { "bir|BlockIncludeRange=", "Match blocks of type between {0:V1} and {1:V2}, inclusive.  This option is repeatable.",
                    (v1, v2) => {
                        int i1 = Math.Max(0, Convert.ToInt32(v1));
                        int i2 = Math.Max(0, Convert.ToInt32(v2));
                        _includedBlocksRange.Add(new KeyValuePair<int, int>(Math.Min(i1, i2), Math.Max(i1, i2)));
                        //for (int i = i1; i <= i2; i++) {
                        //    _includedBlocks.Add(i);
                        //}
                    } },
                { "bx|BlockExclude=", "Match all blocks except blocks of type {ID}.  This option is repeatable.",
                    v => _excludedBlocks.Add(Convert.ToInt32(v)) },
                { "ber|BlockExcludeRange=", "Match all blocks except blocks of type between {0:V1} and {1:V2}, inclusive.  This option is repeatable.",
                    (v1, v2) => {
                        int i1 = Math.Max(0, Convert.ToInt32(v1));
                        int i2 = Math.Max(0, Convert.ToInt32(v2));
                        _excludedBlocksRange.Add(new KeyValuePair<int, int>(Math.Min(i1, i2), Math.Max(i1, i2)));
                        //for (int i = i1; i <= i2; i++) {
                        //    _excludedBlocks.Add(i);
                        //}
                    } },
                { "nb|BlockAroundEq=", "Update blocks that have block type {ID} as any neighbor.  This option is repeatable.",
                    v => {
                        _blocksAboveEq.Add(Convert.ToInt32(v));
                        _blocksBelowEq.Add(Convert.ToInt32(v));
                        _blocksSideEq.Add(Convert.ToInt32(v));
                    } },
                { "nbya|BlockAboveEq=", "Update blocks that have block type {ID} as their top neighbor.  This option is repeatable.",
                    v => _blocksAboveEq.Add(Convert.ToInt32(v)) },
                { "nbyb|BlockBelowEq=", "Update blocks that have block type {ID} as their bottom neighbor.  This option is repeatable.",
                    v => _blocksBelowEq.Add(Convert.ToInt32(v)) },
                { "nbs|BlockSideEq=", "Update blocks that have block type {ID} as one or more side neighbors.  This option is repeatable.",
                    v => _blocksSideEq.Add(Convert.ToInt32(v)) },
                { "nbx|BlockAroundNeq=", "Update blocks that don't have block type {ID} as any neighbor.  This option is repeatable.",
                    v => {
                        _blocksAboveNeq.Add(Convert.ToInt32(v));
                        _blocksBelowNeq.Add(Convert.ToInt32(v));
                        _blocksSideNeq.Add(Convert.ToInt32(v));
                    } },
                { "nbyax|BlockAboveNeq=", "Update blocks that don't have block type {ID} as their top neighbor.  This option is repeatable.",
                    v => _blocksAboveNeq.Add(Convert.ToInt32(v)) },
                { "nbybx|BlockBelowNeq=", "Update blocks that don't have block type {ID} as their bottom neighbor.  This option is repeatable.",
                    v => _blocksBelowNeq.Add(Convert.ToInt32(v)) },
                { "nbsx|BlockSideNeq=", "Update blocks that don't have block type {ID} as one or more side neighbors.  This option is repeatable.",
                    v => _blocksSideNeq.Add(Convert.ToInt32(v)) },
                { "bp|BlockProbability=", "Selects a matching block with probability {VAL} (0.0-1.0)",
                    v => _prob = Convert.ToDouble(v) },
                { "di|DataInclude=", "Match qualifying blocks with data value {VAL}.  This opion is repeatable.",
                    var => _includedData.Add(Convert.ToInt32(var)) },
                { "dir|DataIncludeRange=", "Match qualifying blocks with data value between {0:V1} and {1:V2}, inclusive.  This option is repeatable.",
                    (v1, v2) => {
                        int i1 = Math.Max(0, Convert.ToInt32(v1));
                        int i2 = Math.Max(0, Convert.ToInt32(v2));
                        for (int i = i1; i <= i2; i++) {
                            _includedData.Add(i);
                        }
                    } },
                { "dx|DataExclude=", "Match all qualifying blocks except blocks with data value {VAL}.  This opion is repeatable.",
                    var => _excludedData.Add(Convert.ToInt32(var)) },
                { "der|DataExcludeRange=", "Match all qualifying blocks except blocks with data value between {0:V1} and {1:V2}, inclusive.  This option is repeatable.",
                    (v1, v2) => {
                        int i1 = Math.Max(0, Convert.ToInt32(v1));
                        int i2 = Math.Max(0, Convert.ToInt32(v2));
                        for (int i = i1; i <= i2; i++) {
                            _excludedData.Add(i);
                        }
                    } },
            };
        }

Same methods

BlockFilter::BlockFilter ( string args ) : System