Skip to content

Commit

Permalink
Refactor reset-sub to be private to reset-all-subs
Browse files Browse the repository at this point in the history
  • Loading branch information
butzopower committed Nov 12, 2023
1 parent 5e40c9f commit 2c1aa3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/clj/game/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@
reset-all-ice
reset-all-subs
reset-all-subs!
reset-sub
resolve-subroutine
resolve-subroutine!
resolve-unbroken-subs!
Expand Down
7 changes: 2 additions & 5 deletions src/clj/game/core/ice.clj
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,11 @@
[state ice]
(update! state :corp (dont-resolve-all-subroutines ice)))

(defn reset-sub
[sub]
(dissoc sub :broken :fired :resolve))

(defn reset-all-subs
"Mark all broken/fired subroutines as unbroken/unfired"
[ice]
(update ice :subroutines #(into [] (map reset-sub %))))
(letfn [(reset-sub [sub] (dissoc sub :broken :fired :resolve))]
(update ice :subroutines #(into [] (map reset-sub %)))))

(defn reset-all-subs!
"Marks all broken subroutines as unbroken, update!s state"
Expand Down

0 comments on commit 2c1aa3b

Please sign in to comment.