This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension Array { | |
mutating func removeFirst(where shouldBeRemoved: (Element) throws -> Bool) rethrows { | |
guard let index = try firstIndex(where: shouldBeRemoved) else { | |
return; | |
} | |
remove(at: index) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Dictionary where Key == Int64, Value == SKNode { | |
func int64key(_ key: (Int32, Int32)) -> Int64 { | |
return (Int64(key.0) << 32) | Int64(key.1) | |
} | |
subscript(_ key: (Int32, Int32)) -> SKNode? { | |
get { | |
return self[int64key(key)] | |
} | |
set(newValue) { |