fCraft.BuildingCommands.DrawOperationBegin C# (CSharp) Method

DrawOperationBegin() public static method

public static DrawOperationBegin ( Player player, Command cmd, DrawOperation op ) : void
player Player
cmd Command
op DrawOperation
return void
        public static void DrawOperationBegin( Player player, Command cmd, DrawOperation op )
        {
            // try to create instance of player's currently selected brush
            // all command parameters are passed to the brush
            IBrushInstance brush = player.Brush.MakeInstance( player, cmd, op );

            // MakeInstance returns null if there were problems with syntax, abort
            if ( brush == null )
                return;
            op.Brush = brush;
            player.SelectionStart( op.ExpectedMarks, DrawOperationCallback, op, Permission.Draw );
            player.Message( "{0}: Click {1} blocks or use &H/Mark&S to make a selection.",
                            op.Description, op.ExpectedMarks );
        }

Usage Example

Example #1
0
 private static void MazeCuboidHandler(Player p, Command cmd)
 {
     try {
         MazeCuboidDrawOperation op = new MazeCuboidDrawOperation(p);
         BuildingCommands.DrawOperationBegin(p, cmd, op);
     } catch (Exception e) {
         Logger.Log(LogType.Error, "Error: " + e.Message);
     }
 }