Skip to content

Commit d099e5b

Browse files
Update README.md
1 parent a03fdd9 commit d099e5b

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,64 @@ func main(){
115115
main()
116116
```
117117

118+
We checked-out ‘PlayerTwo’ and then checked-in another guest named ‘PlayerThree’.
119+
120+
Output in the Xcode console:
121+
122+
1 - PlayerOne
123+
2 - PlayerTwo
124+
------------------------------------
125+
1 - PlayerOne
126+
------------------------------------
127+
1 - PlayerOne
128+
3 - PlayerThree
129+
130+
Now change the main method to following:
131+
132+
```
133+
func main(){
134+
let teamRegister = TeamRegister()
135+
let player1 = teamRegister.checkInGuest("PlayerOne")
136+
let player2 = teamRegister.checkInGuest("PlayerTwo")
137+
138+
print(teamRegister)
139+
140+
teamRegister.checkOutGuest(1)
141+
print("------------------------------------")
142+
print(teamRegister)
143+
144+
let player3 = teamRegister.checkInGuest("PlayerThree")
145+
146+
print("------------------------------------")
147+
print(teamRegister)
148+
149+
print("------------------------------------")
150+
let teamBus = TeamConveyance()
151+
teamBus.takePlayersToStadium(teamRegister)
152+
153+
print("-------Match Over ----------")
154+
teamBus.dropPlayersBackAtHotel()
155+
}
156+
157+
main()
158+
```
159+
160+
We are taking an instance of TeamConveyance to drop players at stadium and get them back at hotel after the match is over.
161+
162+
Output in the Xcode console:
163+
164+
1 - PlayerOne
165+
2 - PlayerTwo
166+
------------------------------------
167+
1 - PlayerOne
168+
------------------------------------
169+
1 - PlayerOne
170+
3 - PlayerThree
171+
------------------------------------
172+
Taking players
173+
1 - PlayerOne
174+
3 - PlayerThree
175+
to the Stadium
176+
-------Match Over ----------
177+
Dropping all the players back at Hotel
118178

0 commit comments

Comments
 (0)