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

A self-contained DrawOperation that prodivides its own brush. Purpose of this class is mostly to take care of the boilerplate code. More...

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

Public Member Functions

abstract bool ReadParams (CommandReader cmd)
 
- Public Member Functions inherited from fCraft.Drawing.DrawOperation
virtual bool Prepare ([NotNull] 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.
 
virtual bool Begin ()
 Begins the execution of this DrawOperation. Raises DrawOperation.Beginning (cancelable) and DrawOperation.Began events.
 
abstract int DrawBatch (int maxBlocksToDraw)
 
void Cancel ()
 Asynchronously cancels this draw operation.
 
- Public Member Functions inherited from fCraft.Drawing.IBrushFactory
IBrush MakeBrush ([NotNull] Player player,[NotNull] CommandReader cmd)
 Creates a new brush for a player, based on given parameters.
 
- Public Member Functions inherited from fCraft.Drawing.IBrush
IBrushInstance MakeInstance ([NotNull] Player player,[NotNull] CommandReader cmd,[NotNull] DrawOperation op)
 Creates an instance for this configured brush, for use with a specific DrawOperation.
 
- Public Member Functions inherited from fCraft.Drawing.IBrushInstance
bool Begin ([NotNull] Player player,[NotNull] DrawOperation op)
 Called when the DrawOperation starts. Should be used to verify that the brush is ready for use. Resources used by the brush should be obtained here.
 
Block NextBlock ([NotNull] DrawOperation op)
 Provides the next Block type for the given DrawOperation.
 
void End ()
 Called when the DrawOperation is done or cancelled. Resources used by the brush should be freed/disposed here.
 

Protected Member Functions

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

Properties

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

A self-contained DrawOperation that prodivides its own brush. Purpose of this class is mostly to take care of the boilerplate code.

Constructor & Destructor Documentation

fCraft.Drawing.DrawOpWithBrush.DrawOpWithBrush ( Player  player)
protected

Member Function Documentation

abstract Block fCraft.Drawing.DrawOpWithBrush.NextBlock ( )
protectedpure virtual
abstract bool fCraft.Drawing.DrawOpWithBrush.ReadParams ( CommandReader  cmd)
pure virtual

Property Documentation

abstract override string fCraft.Drawing.DrawOpWithBrush.Description
get

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