Skip to content

Commit

Permalink
Style: don't handle SimpleOneShotEffects in a different function
Browse files Browse the repository at this point in the history
  • Loading branch information
MedeaMelana committed Nov 7, 2012
1 parent 5eb9ff8 commit 234eed7
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Engine.hs
Expand Up @@ -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



Expand Down

0 comments on commit 234eed7

Please sign in to comment.