protected override void GetMarks(DrawArgs dArgs, ref Vec3S32[] m) { AdvDrawMeta meta = (AdvDrawMeta)dArgs.Meta; int radius = meta.radius; Vec3S32 P = m[0]; m = new Vec3S32[] { new Vec3S32(P.X - radius, P.Y, P.Z - radius), new Vec3S32(P.X + radius, P.Y, P.Z + radius), }; if (UsesHeight(dArgs)) { m[1].Y += meta.height - 1; } else { m[0].Y -= radius; m[1].Y += radius; } }
protected override DrawOp GetDrawOp(DrawArgs dArgs) { AdvDrawOp op = null; switch (dArgs.Mode) { case DrawMode.cone: op = new AdvConeDrawOp(); break; case DrawMode.hcone: op = new AdvHollowConeDrawOp(); break; case DrawMode.icone: op = new AdvConeDrawOp(true); break; case DrawMode.hicone: op = new AdvHollowConeDrawOp(true); break; case DrawMode.pyramid: op = new AdvPyramidDrawOp(); break; case DrawMode.hpyramid: op = new AdvHollowPyramidDrawOp(); break; case DrawMode.ipyramid: op = new AdvPyramidDrawOp(true); break; case DrawMode.hipyramid: op = new AdvHollowPyramidDrawOp(true); break; case DrawMode.sphere: op = new AdvSphereDrawOp(); break; case DrawMode.hsphere: op = new AdvHollowSphereDrawOp(); break; case DrawMode.volcano: op = new AdvVolcanoDrawOp(); break; } if (op == null) { Help(dArgs.Player); return(null); } AdvDrawMeta meta = new AdvDrawMeta(); bool success = false; string[] args = dArgs.Message.SplitSpaces(); Player p = dArgs.Player; if (op.UsesHeight) { if (args.Length < 3) { p.Message("You need to provide the radius and the height for the {0}.", args[0]); } else { success = CommandParser.GetInt(p, args[1], "radius", ref meta.radius, 0, 2000) && CommandParser.GetInt(p, args[2], "height", ref meta.height, 0, 2000); } } else { if (args.Length < 2) { p.Message("You need to provide the radius for the {0}.", args[0]); } else { success = CommandParser.GetInt(p, args[1], "radius", ref meta.radius, 0, 2000); } } if (!success) { return(null); } dArgs.Meta = meta; return(op); }