Update vban.ps1

move $this.id into base class

remove unnecessary assignment
This commit is contained in:
onyx-and-iris 2022-01-08 16:11:40 +00:00
parent c31f169b0b
commit 0e11648078

View File

@ -4,8 +4,9 @@ class Vban {
[Array]$stringparams [Array]$stringparams
# Constructor # Constructor
Vban() Vban($id)
{ {
$this.id = $id
$this.stringparams = @('name', 'ip') $this.stringparams = @('name', 'ip')
} }
@ -170,9 +171,8 @@ class Vban {
class VbanInstream : Vban { class VbanInstream : Vban {
# Constructor # Constructor
VbanInstream ($id) VbanInstream ([int]$id) : base ($id)
{ {
$this.id = $id
$this.direction = "in" $this.direction = "in"
} }
} }
@ -180,9 +180,8 @@ class VbanInstream : Vban {
class VbanOutstream : Vban { class VbanOutstream : Vban {
# Constructor # Constructor
VbanOutstream ($id) VbanOutstream ([int]$id) : base ($id)
{ {
$this.id = $id
$this.direction = "out" $this.direction = "out"
} }
} }
@ -198,9 +197,8 @@ Function Vban {
[void]$outstream.Add([VbanOutstream]::new($_)) [void]$outstream.Add([VbanOutstream]::new($_))
} }
$obj = [PSCustomObject]@{ [PSCustomObject]@{
instream = $instream instream = $instream
outstream = $outstream outstream = $outstream
} }
return $obj
} }