@@ -2428,10 +2428,10 @@ $this.PathAttribute = [Ordered]@{'fill-rule' = $fillRule.ToLower()}
24282428 Gets the current heading of the turtle.
24292429#>
24302430param()
2431- if ($null -ne $this.'.TurtleHeading') {
2432- return $this.'.TurtleHeading'
2431+ if ($this -and -not $this.psobject.properties[ '.TurtleHeading'] ) {
2432+ $this.psobject.properties.add([PSNoteProperty]::new( '.TurtleHeading', 0.0), $false)
24332433}
2434- return 0
2434+ return $this.'.TurtleHeading'
24352435
24362436
24372437 </GetScriptBlock >
@@ -2454,12 +2454,6 @@ if ($this -and -not $this.psobject.properties['.TurtleHeading']) {
24542454 $this.psobject.properties.add([PSNoteProperty]::new('.TurtleHeading', 0), $false)
24552455}
24562456$this.'.TurtleHeading' = $Heading
2457-
2458- # $this.psobject.properties.add([PSNoteProperty]::new('.TurtleHeading', $Heading), $false)
2459- # $this | Add-Member -MemberType NoteProperty -Force -Name '.TurtleHeading' -Value $Heading
2460- if ($VerbosePreference -ne 'SilentlyContinue') {
2461- Write-Verbose "Heading to $Heading"
2462- }
24632457 </SetScriptBlock >
24642458 </ScriptProperty >
24652459 <ScriptProperty >
@@ -2532,13 +2526,12 @@ return $true
25322526[bool]
25332527$IsDown
25342528)
2535-
2536- $this |
2537- Add-Member -MemberType NoteProperty -Force -Name '.IsPenDown' -Value $IsDown
2538-
2539- if ($VerbosePreference -ne 'SilentlyContinue') {
2540- Write-Verbose "Turtle is now $($IsDown ? 'down' : 'up')"
2529+ if ($null -eq $this.'.IsPenDown') {
2530+ $this | Add-Member -MemberType NoteProperty -Force -Name '.IsPenDown' -Value $IsDown
2531+ } else {
2532+ $this.'.IsPenDown' = $IsDown
25412533}
2534+
25422535 </SetScriptBlock >
25432536 </ScriptProperty >
25442537 <ScriptProperty >
0 commit comments