-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Philip Niedertscheider
committed
Sep 11, 2021
1 parent
9b36dc6
commit 9d8a95e
Showing
23 changed files
with
705 additions
and
439 deletions.
There are no files selected for viewing
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
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Foundation | ||
|
||
public indirect enum CDIndexNode: Equatable, Hashable, Identifiable { | ||
|
||
case root | ||
case leaf(Int) | ||
case nested(parent: CDIndexNode, index: Int) | ||
|
||
public var id: [Int] { | ||
switch self { | ||
case .root: | ||
return [0] | ||
case .leaf(let index): | ||
return [index] | ||
case .nested(parent: let parent, index: let index): | ||
return parent.id + [index] | ||
} | ||
} | ||
} |
Oops, something went wrong.