fCraft  0.638
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
fCraft.Drawing.BlockDBDrawOperation Class Reference

Draw operation that applies changes from a given BlockDBEntry array. More...

+ Inheritance diagram for fCraft.Drawing.BlockDBDrawOperation:
+ Collaboration diagram for fCraft.Drawing.BlockDBDrawOperation:

Public Member Functions

 BlockDBDrawOperation (Player player, string commandName, string paramDescription, int expectedMarks)
 
bool Prepare (Vector3I[] marks, BlockDBEntry[] changesToApply)
 
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 int DrawBatch (int maxBlocksToDraw)
 
override bool ReadParams (CommandReader cmd)
 

Protected Member Functions

override Block NextBlock ()
 
- Protected Member Functions inherited from fCraft.Drawing.DrawOpWithBrush
 DrawOpWithBrush (Player player)
 
- Protected Member Functions inherited from fCraft.Drawing.DrawOperation
 DrawOperation ([NotNull] Player player)
 
bool DrawOneBlock ()
 

Properties

override string Name [get]
 
override string Description [get]
 
override int ExpectedMarks [get]
 
- Properties inherited from fCraft.Drawing.DrawOpWithBrush
abstract 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]
 
- Properties inherited from fCraft.Drawing.IBrushFactory
string Name [get]
 Name of the brush. Should be unique.
 
string Help [get]
 Information printed to the player when they call "/help brush ThisBrushesName". Should include description and usage information.
 
string[] Aliases [get]
 List of aliases/alternate names for this brush. May be null.
 
- Properties inherited from fCraft.Drawing.IBrush
IBrushFactory Factory [get]
 IBrushFactory associated with this brush type.
 
string Description [get]
 A compact readable summary of brush type and configuration.
 
- Properties inherited from fCraft.Drawing.IBrushInstance
IBrush Brush [get]
 Configured brush that created this instance.
 
string InstanceDescription [get]
 A compact readable summary of brush type, configuration, and state.
 
int AlternateBlocks [get]
 Whether the brush is capable of providing alternate blocks (e.g. for filling hollow DrawOps).
 

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.
 
- 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 applies changes from a given BlockDBEntry array.

Constructor & Destructor Documentation

fCraft.Drawing.BlockDBDrawOperation.BlockDBDrawOperation ( Player  player,
string  commandName,
string  paramDescription,
int  expectedMarks 
)

Member Function Documentation

override int fCraft.Drawing.BlockDBDrawOperation.DrawBatch ( int  maxBlocksToDraw)
virtual
override Block fCraft.Drawing.BlockDBDrawOperation.NextBlock ( )
protectedvirtual
bool fCraft.Drawing.BlockDBDrawOperation.Prepare ( Vector3I[]  marks,
BlockDBEntry[]  changesToApply 
)
override bool fCraft.Drawing.BlockDBDrawOperation.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.

override bool fCraft.Drawing.BlockDBDrawOperation.ReadParams ( CommandReader  cmd)
virtual

Property Documentation

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

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