fCraft.Drawing.CuboidDrawOperation.Prepare C# (CSharp) Method

Prepare() public method

public Prepare ( Vector3I marks ) : bool
marks Vector3I
return bool
        public override bool Prepare(Vector3I[] marks) {
            if (!base.Prepare(marks)) return false;
            BlocksTotalEstimate = Bounds.Volume;
            Coords = Bounds.MinVertex;
            return true;
        }

Usage Example

Esempio n. 1
0
        public void Remove(Player requester)
        {
            NormalBrush brush = new NormalBrush(Block.Air, Block.Air);
            DrawOperation removeOperation = new CuboidDrawOperation(requester);
            removeOperation.AnnounceCompletion = false;
            removeOperation.Brush = brush;
            removeOperation.Context = BlockChangeContext.Portal;

            if (this.AffectedBlocks == null)
            {
                this.AffectedBlocks = new Vector3I[2];
                this.AffectedBlocks[0] = new Vector3I(Range.Xmin, Range.Ymin, Range.Zmin);
                this.AffectedBlocks[1] = new Vector3I(Range.Xmax, Range.Ymax, Range.Zmax);
            }

            if (!removeOperation.Prepare(this.AffectedBlocks))
            {
                throw new PortalException("Unable to remove portal.");
            }

            removeOperation.Begin();

            lock (requester.World.Portals.SyncRoot)
            {
                requester.World.Portals.Remove(this);
            }

            PortalDB.Save();
        }