Slide 6
Slide 6 text
1IBOUPN5ZQFΛͬͨ
Ϋϥεఆٛ
class PokemonStateType {}
class Struggle: PokemonStateType {} // ઓಆঢ়ଶ
class Calm: PokemonStateType {} // ٳܜঢ়ଶ
class Pokemon {
static func use() -> Pokemon {
return Pokemon()
}
func ready() -> Pokemon {
return Pokemon()
}
}
extension Pokemon where T: Struggle {
func attack() {}
}