update meta.ps1

rename $this to $obj to avoid saving over keyword.
This commit is contained in:
onyx-and-iris 2022-01-08 20:30:36 +00:00
parent 0e11648078
commit 2775d64e47
3 changed files with 8 additions and 13 deletions

View File

@ -26,9 +26,6 @@ Function Setup_DLL {
return $false
}
$Signature = @"
[DllImport(@"$dll")]
public static extern int VBVMR_Login();

View File

@ -1,6 +1,6 @@
Function AddPublicMembers($this) {
Function AddPublicMembers($obj) {
[HashTable]$Signatures = @{}
ForEach($param in $this.bool_params) {
ForEach($param in $obj.bool_params) {
# Define getter
$Signatures["Getter"] = "`$this.Getter(`$this.cmd('{0}'))" -f $param
# Define setter
@ -10,7 +10,7 @@ Function AddPublicMembers($this) {
Addmember
}
ForEach($param in $this.float_params) {
ForEach($param in $obj.float_params) {
# Define getter
$Signatures["Getter"] = "[math]::Round(`$this.Getter(`$this.cmd('{0}')), 1)" -f $param
# Define setter
@ -20,7 +20,7 @@ Function AddPublicMembers($this) {
Addmember
}
ForEach($param in $this.int_params) {
ForEach($param in $obj.int_params) {
# Define getter
$Signatures["Getter"] = "[Int]`$this.Getter(`$this.cmd('{0}'))" -f $param
# Define setter
@ -30,7 +30,7 @@ Function AddPublicMembers($this) {
Addmember
}
ForEach($param in $this.string_params) {
ForEach($param in $obj.string_params) {
# Define getter
$Signatures["Getter"] = "[String]`$this.Getter_String(`$this.cmd('{0}'))" -f $param
# Define setter
@ -48,5 +48,5 @@ Function Addmember{
Value = [ScriptBlock]::Create($Signatures["Getter"])
SecondValue = [ScriptBlock]::Create($Signatures["Setter"])
}
$this | Add-Member @AddMemberParams
$obj | Add-Member @AddMemberParams
}

View File

@ -171,8 +171,7 @@ class Vban {
class VbanInstream : Vban {
# Constructor
VbanInstream ([int]$id) : base ($id)
{
VbanInstream ([int]$id) : base ($id){
$this.direction = "in"
}
}
@ -180,8 +179,7 @@ class VbanInstream : Vban {
class VbanOutstream : Vban {
# Constructor
VbanOutstream ([int]$id) : base ($id)
{
VbanOutstream ([int]$id) : base ($id){
$this.direction = "out"
}
}