Skip to content
Browse files

Style: don't handle SimpleOneShotEffects in a different function

  • Loading branch information...
1 parent 5eb9ff8 commit 234eed7bd01adc0e3db08c4141fb406cfa713522 @MedeaMelana committed Nov 7, 2012
Showing with 7 additions and 8 deletions.
  1. +7 −8 Engine.hs
View
15 Engine.hs
@@ -186,14 +186,13 @@ executeEffect e = applyReplacementEffects e >>= mapM_ compileEffect
-- Compilation of effects
compileEffect :: OneShotEffect -> Engine ()
-compileEffect (Will e) = compileSimpleEffect e
-compileEffect (WillMoveObject rObj rToZone obj) = moveObject rObj rToZone obj
-
-compileSimpleEffect :: SimpleOneShotEffect -> Engine ()
-compileSimpleEffect (UntapPermanent i) = untapPermanent i
-compileSimpleEffect (DrawCard rp) = drawCard rp
-compileSimpleEffect (ShuffleLibrary rPlayer) = shuffleLibrary rPlayer
-compileSimpleEffect _ = undefined
+compileEffect e =
+ case e of
+ WillMoveObject rObj rToZone obj -> moveObject rObj rToZone obj
+ Will (UntapPermanent i) -> untapPermanent i
+ Will (DrawCard rp) -> drawCard rp
+ Will (ShuffleLibrary rPlayer) -> shuffleLibrary rPlayer
+ _ -> undefined

0 comments on commit 234eed7

Please sign in to comment.
Something went wrong with that request. Please try again.