< Previous | Contents | Next >
Introducing the Game Lobby Program
The Game Lobby program simulates a game lobby—a waiting area for players, usually in an online game. The program doesn’t actually involve an online component. It creates a single line in which players can wait. The user of the program runs the simulation and has four choices. He can add a person to the lobby, remove a person from the lobby (the first person in line is the first to leave), clear out the lobby, or quit the simulation. Figure 9.11 shows the program in action.
316 Chapter 9 n Advanced Classes and Dynamic Memory: Game Lobby
The lobby holds players who are removed in the order in which they were added.