Skip to content

Instantly share code, notes, and snippets.

@joanmolinas
Last active March 8, 2018 19:21
Show Gist options
  • Save joanmolinas/94d2a7fa65ee198d9632c7c5e4da61dd to your computer and use it in GitHub Desktop.
Save joanmolinas/94d2a7fa65ee198d9632c7c5e4da61dd to your computer and use it in GitHub Desktop.
class Team {
var runners: [Runner] = ...
var riders: [Rider] = ...
var swimmers: [Swimmer] = ...
func reset() {
runners.forEach{ $0.reset() }
riders.forEach { $0.reset() }
swimmers.forEach { $0.reset() }
}
}
class Runner {
func reset() {
// Do stuff
}
}
class Rider {
func reset() {
// Do stuff
}
}
class Swimmer {
func reset() {
// Do stuff
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment