Game/Stand.ps1
$game.DealerHand = @($game.DealerHand |Where-Object { $_.Number -ne 0 }) do { $game.DealerHand += [PSCustomObject]@{ PSTypeName='PowerArcade.PlayingCard' Number = 1..13 | Get-Random Suite = '♠','♣','♥','♦' | Get-Random X = [int]($game.Width * .75) + (3 * $game.DealerHand.Count) Y = [int]($game.Height * .25) + (2 * $game.DealerHand.Count) } $game.ShowHands() $dealerScore = $game.MeasureScore($game.DealerHand) Start-Sleep -Milliseconds 500 if ($dealerScore.SoftTotal -ge 17) { break } } while ($dealerScore.RealTotal -lt 17) $gameStatus = $game.CompareScore() $game | Add-Member NoteProperty Status $gameStatus -Force if ($gameStatus) { [PSCustomObject]@{ PSTypeName='PowerArcade.MessageBox' Message=$gameStatus Border =$true } | Out-String -Width 1kb | Write-Host -NoNewline } $game.UpdateBank() $game | Add-Member NoteProperty IsStanding $true -Force |