Game Development Reference
In-Depth Information
Dim surname As String
Debug.WriteLine("+++++++++ LOADING NEW PEOPLE.")
'Remove prior people.
Roster.Clear()
'Load up the roster with new people.
For Each surname In people
Roster.Add(New Person(surname, MDB))
Next
End Sub
Uncomment the call to PeopleButton_Click that is near the end of the
Cruise_Load event handler. We had commented it earlier because we lacked any
people code. Now that we have the Person class complete, we can do more
testing.
Run this code in the debugger and look at the output in the Immediate window.
Click the People button. The code claims to be loading new people. We would
like to see these people. Stop debugging and add the flowing code to the Cruise
class:
'Dump all of the people and their relationships.
Private Sub DumpButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles DumpButton.Click
'Dump all of the pair-wise relationships.
Dim PersonA As Person
Dim PersonB As Person
'Do all of the people.
For Each PersonA In Roster
'Make some blank space for readability.
Debug.WriteLine("")
'Dump my personal stats.
Debug.WriteLine(PersonA.LongDump)
'Do all of the pair-wise relationships.
For Each PersonB In Roster
'(With everyone but me.)
If PersonA IsNot PersonB Then
Call DumpRelationship(PersonA, PersonB)
End If
Next
Next
End Sub
 
Search Nedrilad ::




Custom Search