Skip to content

Commit

Permalink
fix: canAcuireの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroma6666 committed Dec 14, 2024
1 parent 1680ffe commit 95d772f
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,10 @@ object ManaManipulation {
}
}
override def canAcquire(amount: ManaAmount): F[Boolean] = {
dragonNightTimeMultiplierRef.get.flatMap { multiplier =>
ref.modify { original =>
original.tryConsume(amount)(multiplier) match {
case Some(reduced) => (reduced, true)
case None => (original, false)
}
}
}
for {
multiplier <- dragonNightTimeMultiplierRef.get
original <- ref.get
} yield original.tryUse(amount)(multiplier).isDefined
}
}

Expand Down

0 comments on commit 95d772f

Please sign in to comment.