fCraft.BuildingCommands.CutHandler C# (CSharp) Method

CutHandler() private static method

private static CutHandler ( Player player, Command cmd ) : void
player Player
cmd Command
return void
        private static void CutHandler( Player player, Command cmd )
        {
            Block fillBlock = Block.Air;
            if ( cmd.HasNext ) {
                fillBlock = cmd.NextBlock( player );
                if ( fillBlock == Block.Undefined )
                    return;
                if ( cmd.HasNext ) {
                    CdCut.PrintUsage( player );
                    return;
                }
            }

            CutDrawOperation op = new CutDrawOperation( player ) {
                Brush = new NormalBrush( fillBlock )
            };

            player.SelectionStart( 2, DrawOperationCallback, op, Permission.Draw );
            if ( fillBlock != Block.Air ) {
                player.Message( "Cut/{0}: Click 2 blocks or use &H/Mark&S to make a selection.",
                                fillBlock );
            } else {
                player.Message( "Cut: Click 2 blocks or use &H/Mark&S to make a selection." );
            }
        }