P3D-Legacy/P3D/World/ActionScript/V2/ScriptConstructs/DoStorage.vb

28 lines
1.1 KiB
VB.net
Raw Normal View History

2016-09-07 18:50:38 +02:00
Namespace ScriptVersion2
Partial Class ScriptComparer
' --------------------------------------------------------------------------------------------------------------------------
' Contains the <storage> constructs.
' --------------------------------------------------------------------------------------------------------------------------
2016-09-07 18:50:38 +02:00
Private Shared Function DoStorage(ByVal subClass As String) As Object
Dim command As String = GetSubClassArgumentPair(subClass).Command
Dim argument As String = GetSubClassArgumentPair(subClass).Argument
Select Case command.ToLower()
Case "get"
Dim type As String = argument.Remove(argument.IndexOf(","))
Dim name As String = argument.Remove(0, argument.IndexOf(",") + 1)
Return ScriptStorage.GetObject(type, name)
Case "count"
Return ScriptStorage.Count(argument)
End Select
Return DEFAULTNULL
End Function
End Class
End Namespace