Skip to content

Commit 9098c85

Browse files
feat: Turtle.Clear() steps and Turtles ( Fixes #223, Fixes #224 )
1 parent d1d4378 commit 9098c85

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Types/Turtle/Clear.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1+
<#
2+
.SYNOPSIS
3+
Clears a Turtle
4+
.DESCRIPTION
5+
Clears the heading, steps, position, minimim, maximum, and any nested Turtles.
6+
.EXAMPLE
7+
turtle square 42 clear circle 21
8+
#>
19
$this.Heading = 0
2-
$this.Steps = @()
10+
if ($this.Steps.Clear) {
11+
$this.Steps.Clear()
12+
}
313
$this | Add-Member -MemberType NoteProperty -Force -Name '.Position' -Value ([pscustomobject]@{ X = 0; Y = 0 })
414
$this | Add-Member -MemberType NoteProperty -Force -Name '.Minimum' -Value ([pscustomobject]@{ X = 0; Y = 0 })
515
$this | Add-Member -MemberType NoteProperty -Force -Name '.Maximum' -Value ([pscustomobject]@{ X = 0; Y = 0 })
616
$this.ViewBox = 0
17+
$this.Turtles.Clear()
718
return $this

0 commit comments

Comments
 (0)