Last active
March 17, 2021 13:06
-
-
Save pitt500/13634029f657ab9b0de6cef41b55ebd2 to your computer and use it in GitHub Desktop.
SoccerPlayer code requiered for video "Protocols in Swift Pt 2: Methods, initializers & extensions" https://youtu.be/qiMFIopQJME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Player { | |
var name: String { get set } | |
var score: Int { get } | |
var nickname: String { get } | |
static var numberOfPlayers: Int { get set } | |
} | |
struct SoccerPlayer: Player { | |
var name: String | |
var score: Int | |
var nickname: String | |
static var numberOfPlayers: Int = 1 | |
var jerseyNumber: Int | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment