Skip to content

Instantly share code, notes, and snippets.

@leifwickland
Last active February 6, 2016 21:30
Show Gist options
  • Save leifwickland/f4053b4ff56d3823c61d to your computer and use it in GitHub Desktop.
Save leifwickland/f4053b4ff56d3823c61d to your computer and use it in GitHub Desktop.
sealed trait Pokemon {
def name: String
def elemental: String
}
object Pokemon {
final val Values: Seq[Pokemon] = themAll[Pokemon]
// Produces: Seq(
// Bulbasaur,
// Ivysaur,
// Venusaur,
// Charmeleon,
// Charizard,
// Squirtle,
// Charmander
// )
}
abstract class PokemonBase(val name: String, val elemental: String) extends Pokemon
object Bulbasaur extends PokemonBase("フシギダネ", "Grass")
object Ivysaur extends PokemonBase("フシギソウ", "Grass")
object Venusaur extends PokemonBase("フシギバナ", "Grass")
object Charmeleon extends PokemonBase("リザード", "Fire")
object Charizard extends PokemonBase("リザードン", "Fire")
object Squirtle extends PokemonBase("ゼニガメ", "Water")
object Charmander extends PokemonBase("ヒトカゲ", "Fire")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment