示例#1
0
        protected override void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type, byte extType)
        {
            RevertAndClearState(p, x, y, z);
            CatchPos cpos = (CatchPos)p.blockchangeObject;

            GetRealBlock(type, extType, p, ref cpos);
            DrawOp op          = null;
            int    brushOffset = cpos.mode == DrawMode.normal ? 0 : 1;
            Brush  brush       = GetBrush(p, cpos, brushOffset);

            if (brush == null)
            {
                return;
            }

            switch (cpos.mode)
            {
            case DrawMode.solid:
            case DrawMode.normal:
                op = new EllipsoidDrawOp(); break;

            case DrawMode.hollow:
                op = new EllipsoidHollowDrawOp(); break;

            case DrawMode.vertical:
                op = new CylinderDrawOp(); break;
            }

            if (!DrawOp.DoDrawOp(op, brush, p, cpos.x, cpos.y, cpos.z, x, y, z))
            {
                return;
            }
            if (p.staticCommands)
            {
                p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
            }
        }
示例#2
0
        protected override void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type, byte extType) {
            RevertAndClearState(p, x, y, z);
            CatchPos cpos = (CatchPos)p.blockchangeObject;
            GetRealBlock(type, extType, p, ref cpos);
            DrawOp drawOp = null;
            Brush brush = new SolidBrush(cpos.type, cpos.extType);

            switch (cpos.solid) {
                case SolidType.solid:
                    drawOp = new EllipsoidDrawOp(); break;
                case SolidType.hollow:
                    drawOp = new EllipsoidHollowDrawOp(); break;
                case SolidType.vertical:
                    drawOp = new CylinderDrawOp(); break;
            }
            
            ushort x1 = Math.Min(cpos.x, x), x2 = Math.Max(cpos.x, x);
            ushort y1 = Math.Min(cpos.y, y), y2 = Math.Max(cpos.y, y);
            ushort z1 = Math.Min(cpos.z, z), z2 = Math.Max(cpos.z, z);            
            if (!DrawOp.DoDrawOp(drawOp, brush, p, x1, y1, z1, x2, y2, z2))
                return;
            if (p.staticCommands)
                p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);
        }