private static void Draw2DHandler( Player player, Command cmd )
{
string Shape = cmd.Next();
if ( Shape == null ) {
CdDraw2D.PrintUsage( player );
return;
}
switch ( Shape.ToLower() ) {
case "polygon":
case "star":
case "spiral":
break;
default:
CdDraw2D.PrintUsage( player );
return;
}
int radius = 0;
int Points = 0;
if ( !cmd.NextInt( out radius ) ) {
radius = 20;
}
if ( !cmd.NextInt( out Points ) ) {
Points = 5;
}
bool fill = true;
if ( cmd.HasNext ) {
if ( !bool.TryParse( cmd.Next(), out fill ) ) {
fill = true;
}
}
Draw2DData tag = new Draw2DData() { Shape = Shape, Points = Points, Radius = radius, Fill = fill };
player.Message( "Draw2D({0}): Click 2 blocks or use &H/Mark&S to set direction.", Shape );
player.SelectionStart( 2, Draw2DCallback, tag, Permission.DrawAdvanced );
}