fCraft.Drawing.Fill3DDrawOperation.Begin C# (CSharp) Method

Begin() public method

public Begin ( ) : bool
return bool
        public override bool Begin() {
            if( !RaiseBeginningEvent( this ) ) return false;
            UndoState = Player.DrawBegin( this );
            StartTime = DateTime.UtcNow;

            if( !(Brush is NormalBrush) ) {
                long membef = GC.GetTotalMemory( true );
                // for nonstandard brushes, cache all coordinates up front
                nonStandardBrush = true;

                // Generate a list if all coordinates
                allCoords = new BitMap3D( Bounds );
                while( coordEnumerator.MoveNext() ) {
                    allCoords.Set( coordEnumerator.Current );
                }
                coordEnumerator.Dispose();

                // Replace our F3D enumerator with a HashSet enumerator
                coordEnumerator = allCoords.GetEnumerator();
                long memaf = GC.GetTotalMemory( true );
                Logger.Log( LogType.Debug,
                            "Mem use delta: {0} KB / blocks drawn: {1} / blocks checked: {2} / ratio: {3}%",
                            (memaf - membef)/1024,
                            allCoords.Count,
                            blocksProcessed,
                            (allCoords.Count * 100 ) / blocksProcessed);
            }

            HasBegun = true;
            Map.QueueDrawOp( this );
            RaiseBeganEvent( this );
            return true;
        }