Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Events for beginning and ending of steps

  • Loading branch information...
commit 5a7bfbf851b48b0aba3dc3061c2a962ccb563840 1 parent 04cf2df
@MedeaMelana authored
Showing with 11 additions and 2 deletions.
  1. +9 −1 Engine.hs
  2. +2 −1  Types.hs
View
10 Engine.hs
@@ -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
3  Types.hs
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.