add Login() to Remote class.

method chain it in factory functions.
This commit is contained in:
onyx-and-iris 2022-12-18 16:48:28 +00:00
parent 828a9a5731
commit 150301c271

View File

@ -11,13 +11,17 @@ class Remote {
} }
$this.kind = GetKind($kindId) $this.kind = GetKind($kindId)
$this.profiles = Get_Profiles($this.kind.name) $this.profiles = Get_Profiles($this.kind.name)
Login -KIND $this.kind.name
} }
[string] ToString() { [string] ToString() {
return "Voicemeeter " + $this.kind.name.substring(0, 1).toupper() + $this.kind.name.substring(1) return "Voicemeeter " + $this.kind.name.substring(0, 1).toupper() + $this.kind.name.substring(1)
} }
[Remote] Login() {
Login -kindId $this.kind.name
return $this
}
[void] Logout() { [void] Logout() {
Logout Logout
} }
@ -112,15 +116,15 @@ class RemotePotato : Remote {
} }
Function Get-RemoteBasic { Function Get-RemoteBasic {
[RemoteBasic]::new() [RemoteBasic]::new().Login()
} }
Function Get-RemoteBanana { Function Get-RemoteBanana {
[RemoteBanana]::new() [RemoteBanana]::new().Login()
} }
Function Get-RemotePotato { Function Get-RemotePotato {
[RemotePotato]::new() [RemotePotato]::new().Login()
} }
Function Connect-Voicemeeter { Function Connect-Voicemeeter {