Skip to content

Commit

Permalink
Add backwards compatibility for reset events
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodewarrior committed Jun 13, 2021
1 parent b3e1b24 commit 943e64e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions SwiftSplit/CelesteSplitter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ struct Event {
mutating func add(variant: String) {
self.variants.insert(variant)
}
mutating func add(variants: String...) {
for variant in variants {
self.variants.insert(variant)
}
}
}

extension Event : ExpressibleByArrayLiteral {
Expand Down Expand Up @@ -125,6 +130,13 @@ class CelesteSplitter {
case .CSide: event.add(variant: "leave c-side \(old.chapter)")
default: break
}
event.add(variants: "reset chapter", "reset chapter \(old.chapter)")
switch new.mode {
case .Normal: event.add(variant: "reset a-side \(old.chapter)")
case .BSide: event.add(variant: "reset b-side \(old.chapter)")
case .CSide: event.add(variant: "reset c-side \(old.chapter)")
default: break
}
events.append(event)
}
if new.chapterComplete && !old.chapterComplete {
Expand Down

0 comments on commit 943e64e

Please sign in to comment.