runOnAttackTriggers :: CardID -> StateT GameState IO ()
runOnAttackTriggers cID = do
  s <- get
  let triggeredAbilities = filter abilityIsTriggered (s^.card cID.abilities)
  let withCorrectTrigger =
        filter (\ (Triggered t _) -> t == OnAttack) triggeredAbilities
  forM_ withCorrectTrigger $ \(Triggered _ f) ->
    when (cID `elem` (s^.attackers)) $
      f $ OnAttackInfo cID

-- runAttackerTriggers :: Monad m => StateT GameState m ()
-- runAttackerTriggers = do
--   s <- get
--   triggeredAbilities <- allTriggeredAbilities
--   let withCorrectTrigger =
--         filter (\ (_,(Triggered t _)) -> t == OnAttack) triggeredAbilities
--   forM_ withCorrectTrigger $ \(cardWithAbility, (Triggered _ f)) ->
--     when (cardWithAbility `elem` (s^.attackers)) $
--       f $ OnAttackInfo cardWithAbility
runOnAttackTriggers :: CardID -> StateT GameState IO ()
runOnAttackTriggers cID = do
  s <- get
  let triggeredAbilities = filter abilityIsTriggered (s^.card cID.abilities)
  let withCorrectTrigger =
        filter (\ (Triggered t _) -> t == OnAttack) triggeredAbilities
  forM_ withCorrectTrigger $ \(Triggered _ f) ->
    when (cID `elem` (s^.attackers)) $
      f $ OnAttackInfo cID

-- runAttackerTriggers :: Monad m => StateT GameState m ()
-- runAttackerTriggers = do
--   s <- get
--   triggeredAbilities <- allTriggeredAbilities
--   let withCorrectTrigger =
--         filter (\ (_,(Triggered t _)) -> t == OnAttack) triggeredAbilities
--   forM_ withCorrectTrigger $ \(cardWithAbility, (Triggered _ f)) ->
--     when (cardWithAbility `elem` (s^.attackers)) $
--       f $ OnAttackInfo cardWithAbility
runOnAttackTriggers cID = do
  s <- get
  let triggeredAbilities = filter abilityIsTriggered (s^.card cID.abilities)
  let withCorrectTrigger =
        filter (\ (Triggered t _) -> t == OnAttack) triggeredAbilities
  forM_ withCorrectTrigger $ \(Triggered _ f) ->
    when (cID `elem` (s^.attackers)) $
      f $ OnAttackInfo cID

-- runAttackerTriggers :: Monad m => StateT GameState m ()
-- runAttackerTriggers = do
--   s <- get
--   triggeredAbilities <- allTriggeredAbilities
--   let withCorrectTrigger =
--         filter (\ (_,(Triggered t _)) -> t == OnAttack) triggeredAbilities
--   forM_ withCorrectTrigger $ \(cardWithAbility, (Triggered _ f)) ->
--     when (cardWithAbility `elem` (s^.attackers)) $
--       f $ OnAttackInfo cardWithAbility