我有一个名为“游戏”的自定义类。假设我创建了这个类的 3 个实例。
Public Class FrmMain
Public Sub addGames()
for x As Integer = 1 To 3 Step 1
Dim game As New game
if x = 1 then game.name = "Zelda"
if x = 2 then game.name = "Mario"
if x = 3 then game.name = "Donkey Kong"
next
End Sub
Public Sub findMario()
'What goes here?
End Sub
End Class
我在我的子“findMario()”中放入什么来获取“游戏”实例的名称属性等于“马里奥”?