Permalink
Browse files

Events for beginning and ending of steps

  • Loading branch information...
1 parent 04cf2df commit 5a7bfbf851b48b0aba3dc3061c2a962ccb563840 @MedeaMelana committed Sep 4, 2012
Showing with 11 additions and 2 deletions.
  1. +9 −1 Engine.hs
  2. +2 −1 Types.hs
View
@@ -55,7 +55,10 @@ liftQuestion = lift . lift . Operational.singleton
round :: Engine ()
round = forever $ do
players ~:* set manaPool []
- nextStep >>= executeStep
+ step <- nextStep
+ raise (BeginStep step)
+ executeStep step
+ raise (EndStep step)
nextStep :: Engine Step
nextStep = do
@@ -65,6 +68,11 @@ nextStep = do
activeStep =: s
return s
+raise :: Event -> Engine ()
+raise _ = do
+ -- TODO handle triggered abilities
+ return ()
+
-- Execution of steps
View
@@ -285,7 +285,8 @@ data Event
| PlayLand ObjectRef
| RegeneratePermanent ObjectRef
| RevealCard ObjectRef
- | ChangeStep Step Step -- old step, new step
+ | BeginStep Step
+ | EndStep Step
| LoseGame PlayerRef
data OneShotEffect

0 comments on commit 5a7bfbf

Please sign in to comment.