Skip to content

Commit 46d0a0f

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.Clear() steps and Turtles ( Fixes #223, Fixes #224 )
1 parent 9098c85 commit 46d0a0f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Turtle.types.ps1xml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,12 +486,23 @@ return $this
486486
<ScriptMethod>
487487
<Name>Clear</Name>
488488
<Script>
489-
$this.Heading = 0
490-
$this.Steps = @()
489+
&lt;#
490+
.SYNOPSIS
491+
Clears a Turtle
492+
.DESCRIPTION
493+
Clears the heading, steps, position, minimim, maximum, and any nested Turtles.
494+
.EXAMPLE
495+
turtle square 42 clear circle 21
496+
#&gt;
497+
$this.Heading = 0
498+
if ($this.Steps.Clear) {
499+
$this.Steps.Clear()
500+
}
491501
$this | Add-Member -MemberType NoteProperty -Force -Name '.Position' -Value ([pscustomobject]@{ X = 0; Y = 0 })
492502
$this | Add-Member -MemberType NoteProperty -Force -Name '.Minimum' -Value ([pscustomobject]@{ X = 0; Y = 0 })
493503
$this | Add-Member -MemberType NoteProperty -Force -Name '.Maximum' -Value ([pscustomobject]@{ X = 0; Y = 0 })
494504
$this.ViewBox = 0
505+
$this.Turtles.Clear()
495506
return $this
496507
</Script>
497508
</ScriptMethod>

0 commit comments

Comments
 (0)