update to class getters/setters and meta module

rename factory functions.

class getters now send is_string parameter.

each property type for each class now has separate meta function.
This commit is contained in:
onyx-and-iris
2022-01-19 21:52:59 +00:00
parent 84d31d3d61
commit 8e03c4e53b
6 changed files with 101 additions and 87 deletions

View File

@@ -1,28 +1,23 @@
class Vban {
[int32]$id
[String]$direction
[Array]$stringparams
# Constructor
Vban($id)
{
$this.id = $id
$this.stringparams = @('name', 'ip')
}
[void] Setter($cmd, $set) {
if( $this.stringparams.Contains($cmd.Split('.')[2]) ) {
Param_Set_String -PARAM $cmd -VALUE $set
}
else { Param_Set -PARAM $cmd -VALUE $set }
}
[Single] Getter($cmd) {
return Param_Get -PARAM $cmd
return Param_Get -PARAM $cmd -IS_STRING $false
}
[String] Getter_String($cmd) {
return Param_Get_String -PARAM $cmd
return Param_Get -PARAM $cmd -IS_STRING $true
}
[void] Setter($cmd, $set) {
Param_Set -PARAM $cmd -VALUE $set
}
[String] cmd ($arg) {
@@ -185,7 +180,7 @@ class VbanOutstream : Vban {
}
Function Vban {
Function Make_Vban {
[System.Collections.ArrayList]$instream = @()
[System.Collections.ArrayList]$outstream = @()