fCraft  0.636
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
Public Member Functions | Properties | List of all members
fCraft.Drawing.CutDrawOperation Class Reference

Draw operation that handles /Cut command. Copies everything into currently-selected copy slot as soon as Begin() is called, then gradually fills the area. More...

Inheritance diagram for fCraft.Drawing.CutDrawOperation:
Inheritance graph
[legend]
Collaboration diagram for fCraft.Drawing.CutDrawOperation:
Collaboration graph
[legend]

Public Member Functions

 CutDrawOperation (Player player)
 
override bool Prepare (Vector3I[] marks)
 Prepares DrawOperation to start. Called after the player made a selection, usually on player's I/O thread. Brush property must be set before calling Prepare.
 
override bool Begin ()
 Begins the execution of this DrawOperation. Raises DrawOperation.Beginning (cancelable) and DrawOperation.Began events.
 
override int DrawBatch (int maxBlocksToDraw)
 
- Public Member Functions inherited from fCraft.Drawing.DrawOperation
void Cancel ()
 Asynchronously cancels this draw operation.
 

Properties

override string Name [get]
 
override int ExpectedMarks [get]
 
override string Description [get]
 
- Properties inherited from fCraft.Drawing.DrawOperation
abstract int ExpectedMarks [get]
 Expected number of marks to pass to DrawOperation.Prepare()
 
IBrushInstance Brush [get, set]
 Brush used to determine which blocks to place. Must be assigned before DrawOperation.Prepare() is called.
 
BlockChangeContext Context [get, set]
 Block change context, to be reported to BlockDB and Player.PlacingBlock/PlacedBlock events. Should include BlockChangeContext.Drawn flag.
 
Vector3I[] Marks [get, set]
 Marks given by the player to this command. Marks could come from either clicks or /Mark command. Set by DrawOperation.Prepare()
 
DateTime StartTime [get, set]
 Time when the draw operatation began. Set by DrawOperation.Begin()
 
BoundingBox Bounds [get, set]
 Area that bounds the DrawOperation's extent, if possible to estimate in advance. Used for logging. Should be assigned, as accurately as possible, before DrawOp finishes.
 
bool HasBegun [get, set]
 Whether this operation has been started (queued for processing on the Map).
 
bool IsDone [get, set]
 Whether this operation is done (has finished or had been cancelled).
 
bool IsCancelled [get, set]
 Whether this operation has been cancelled (e.g. by /Undo or /WLock).
 
int BlocksProcessed [get, set]
 Number of blocks/coordinates that were considered for drawing.
 
int BlocksUpdated [get, set]
 Number of blocks/coordinates that ended up being changed/updated.
 
int BlocksDenied [get, set]
 Number of blocks/coordinates that were supposed to be changed/updated, but were left untouched due to permission issues.
 
int BlocksSkipped [get, set]
 Number of blocks/coordinates that were processed, and left untouched: either because the Brush decided to skip it, or because map's current block matched the desired blocktype.
 
int BlocksTotalEstimate [get, set]
 Estimate of total number of blocks that will be processed by this command. Should be as accurate as reasonably possible by DrawOperation.Prepare(). Used for volume permission checks. Must not be negative.
 
int BlocksLeftToProcess [get]
 Estimated total blocks left to process.
 
int PercentDone [get]
 Approximate completion percentage of this command.
 
int AlternateBlockIndex [get, set]
 Whether the brush should use alternate block (if available) for filling insides of hollow DrawOps. Currently only supported by NormalBrush. Used with CuboidH/CuboidW/EllipsoidH drawops.
 
abstract string Name [get]
 General name of this type of draw operation. Should be same for all instances.
 
virtual string Description [get]
 Compact description of this specific draw operation, with any instance-specific parameters, and the brush's instance description.
 
bool AnnounceCompletion [get, set]
 Whether completion or cancellation of this DrawOperation should be announced to Player.
 
bool LogCompletion [get, set]
 Whether completion or cancellation of this DrawOperation should be logged.
 
bool TimeToEndBatch [get]
 

Additional Inherited Members

- Public Attributes inherited from fCraft.Drawing.DrawOperation
readonly Player Player
 Player who is executing this command. Used for both permission checks and messaging.
 
readonly Map Map
 Map to draw blocks to.
 
Vector3I Coords
 Coordinates that are currently being processed.
 
- Protected Member Functions inherited from fCraft.Drawing.DrawOperation
 DrawOperation ([NotNull] Player player)
 
bool DrawOneBlock ()
 
- Static Protected Member Functions inherited from fCraft.Drawing.DrawOperation
static IEnumerable< Vector3ILineEnumerator (Vector3I a, Vector3I b)
 
static bool RaiseBeginningEvent (DrawOperation op)
 
static void RaiseBeganEvent (DrawOperation op)
 
static void RaiseEndedEvent (DrawOperation op)
 
- Protected Attributes inherited from fCraft.Drawing.DrawOperation
UndoState UndoState
 Undo state associated with this operation. Created by DrawOperation.Begin().
 
- Events inherited from fCraft.Drawing.DrawOperation
static EventHandler
< DrawOperationBeginningEventArgs
Beginning
 
static EventHandler
< DrawOperationEventArgs
Began
 
static EventHandler
< DrawOperationEventArgs
Ended
 

Detailed Description

Draw operation that handles /Cut command. Copies everything into currently-selected copy slot as soon as Begin() is called, then gradually fills the area.

Constructor & Destructor Documentation

fCraft.Drawing.CutDrawOperation.CutDrawOperation ( Player  player)

Member Function Documentation

override bool fCraft.Drawing.CutDrawOperation.Begin ( )
virtual

Begins the execution of this DrawOperation. Raises DrawOperation.Beginning (cancelable) and DrawOperation.Began events.

Returns
True if operation started succesfully. False if operation was canceled by an event callback.

Reimplemented from fCraft.Drawing.DrawOperation.

override int fCraft.Drawing.CutDrawOperation.DrawBatch ( int  maxBlocksToDraw)
virtual
override bool fCraft.Drawing.CutDrawOperation.Prepare ( Vector3I[]  marks)
virtual

Prepares DrawOperation to start. Called after the player made a selection, usually on player's I/O thread. Brush property must be set before calling Prepare.

Parameters
marksArray of marks given by the player.
Returns
True if both DrawOperation and Brush have been prepared succesfully. False if either of them failed.
Exceptions
ArgumentNullExceptionmarks is null.
ArgumentExceptionWrong number of marks is given.
NullReferenceExceptionDrawOperation's Brush property is not set before calling Prepare.

Reimplemented from fCraft.Drawing.DrawOperation.

Property Documentation

override string fCraft.Drawing.CutDrawOperation.Description
get
override int fCraft.Drawing.CutDrawOperation.ExpectedMarks
get
override string fCraft.Drawing.CutDrawOperation.Name
get

The documentation for this class was generated from the following file: