fCraft.DrawCommands.DrawOperationCallback C# (CSharp) Method

DrawOperationCallback() static private method

static private DrawOperationCallback ( [ player, [ marks, [ tag ) : void
player [
marks [
tag [
return void
        static void DrawOperationCallback([NotNull] Player player, [NotNull] Vector3I[] marks, [NotNull] object tag) {
            if (player == null) throw new ArgumentNullException("player");
            if (marks == null) throw new ArgumentNullException("marks");
            if (tag == null) throw new ArgumentNullException("tag");

            DrawOperation op = (DrawOperation)tag;
            if (!op.Prepare(marks)) return;
            if (!player.CanDraw(op.BlocksTotalEstimate)) {
                player.MessageNow(
                    "You are only allowed to run draw commands that affect up to {0} blocks. This one would affect ~{1} blocks.",
                    player.Info.Rank.DrawLimit,
                    op.BlocksTotalEstimate);
                op.Cancel();
                return;
            }
            player.Message("{0}: Processing ~{1} blocks.", op.Description, op.BlocksTotalEstimate);
            op.Begin();
        }