Skip to content

Instantly share code, notes, and snippets.

@arturaz
Created February 6, 2015 09:51
Show Gist options
  • Select an option

  • Save arturaz/7d2a891cf55b1b25c423 to your computer and use it in GitHub Desktop.

Select an option

Save arturaz/7d2a891cf55b1b25c423 to your computer and use it in GitHub Desktop.
def moveAttack[A <: MovableFighter](
world: World, unit: A,
target: SearchRes[OwnedObj], strict: Boolean=true
)(implicit ev: A#Self =:= A): Result[A] = {
moveAndThen(world, unit, target.path, strict) { case (newWorld, movedUnit) =>
movedUnit.attackWS(target.value, newWorld).right.map(_.map {
case (w, u) => (w, u)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment