fCraft.Drawing.BlockPalette.Add C# (CSharp) Method

Add() protected method

protected Add ( LabColor color, Block blocks ) : void
color LabColor
blocks Block
return void
        protected void Add( LabColor color, Block[] blocks )
        {
            if( blocks == null ) {
                throw new ArgumentNullException( "blocks" );
            }
            if( blocks.Length != Layers ) {
                throw new ArgumentException( "Number of blocks must match number the of layers." );
            }
            palette.Add( color, blocks );
        }

Same methods

BlockPalette::Add ( System.Drawing.Color color, [ blocks ) : void

Usage Example

Beispiel #1
0
        static BlockPalette DefineLayeredGray()
        {
            BlockPalette palette = new BlockPalette("LayeredGray", 2);

            foreach (var pair in Gray.palette)
            {
                palette.Add(pair.Key, new[] { Block.None, pair.Value[0] });
            }
            foreach (var pair in DarkGray.palette)
            {
                palette.Add(pair.Key, new[] { pair.Value[0], Block.Air });
            }
            return(palette);
        }
All Usage Examples Of fCraft.Drawing.BlockPalette::Add