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 ); }
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); }