Game Development Reference
In-Depth Information
Dim sn As String = myname & "["
Dim someNeed As NVP
For Each someNeed In myNeeds
sn = sn & " " & someNeed.value.ToString
Next
sn=sn&"]"
Return sn
End Function
Public Function LongDump() As String
Dim ld As String = ""
Dim opinionated As Double = 0.0
Dim view As Integer = 0
Dim attr As NVP
For Each attr In myPreferences
'Strong preferences count more.
opinionated += attr.value * attr.value
'Keep the sign when building their total outlook.
view += attr.value
'Build the string of preferences.
ld = ld & " " & attr.name & "=" & attr.value.ToString
Next
Return (Me.ShortDump & " View=" & view.ToString & " Op=" & _
Format(opinionated / myPreferences.Count, "0.00") & "; " & ld)
End Function
Public Function Name() As String
Return myname
End Function
Now that we can create a database and some people, we are ready for the cruise
director to make an appearance.
Finishing the Cruise Class
Switch to the Code view of the Cruise class. Add code as follows:
Private Sub PeopleButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles PeopleButton.Click
Dim people() As String = {"Drackett", "Jones", "Lincoln", _
"Morrill", "Stradley", "Taylor"}
 
Search Nedrilad ::




Custom Search