 
   return false
 
+# Checks a single move to see if the Pokemon can learn it through level-up,
+# tutors, machines, Sketch, or pre-evolutions.
 checkMove = (looper, pokemon, move) ->
   {level} = pokemon
   valid = false

# Returns an array of moves that this Pokemon can learn for a given generation.
self.learnableMoves = (pokemon, forGeneration) ->

self.checkMoveset = (SpeciesData, FormeData, pokemon, generation, moves) ->
  looper = loopLearnsets.bind(null, SpeciesData, FormeData, pokemon, generation)


  # through level-up, tutoring, machines, or Sketch.
  leftoverMoves = (m  for m in moves when !checkMove(looper, pokemon, m))

  # TODO: form-change learnsets should actually be considered part of the normal
  # moveset, but only for that forme.

  # If there are no leftover moves, then we're done, the moveset is valid.
  return true  if leftoverMoves.length == 0

  # Each Pokemon has certain learnset groups. Standard ones are listed below.
  standardGroups = [ "level-up", "tutor", "machine", "egg" ]

  # Check non-standard groups:
  # "form-change", "light-ball-egg", "stadium-surfing-pikachu"
  return true  if looper (learnset) ->
    nonstandardGroups = (g  for g of learnset when g not in standardGroups)
    # If a non-standard group completely overlaps the leftover moves, the
    # moveset is valid.
    for group in nonstandardGroups
      total = (m  for m in leftoverMoves when m of learnset[group]).length
      return true  if total == leftoverMoves.length

  # This makes it so if the remaining moves are all egg moves, the moveset is
  # valid. That's false, but it's permissive. Later, factor in chain-breeding.
  # TODO: Check chain-breeding.
  eggMoves = []
  looper (learnset) ->
