You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/tick_logic.md
+20-18Lines changed: 20 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,29 +16,29 @@ Let's get to the technical details. There are 3 layers to this architecturally i
16
16
*`Tick.style`
17
17
*`Tick.attemptType`
18
18
19
-
(Here)[https://github.com/OpenBeta/openbeta-graphql/blob/develop/src/graphql/schema/Climb.gql#L115] are all the possible values for `Climb.type`, as defined in the [limb Schema](https://github.com/OpenBeta/openbeta-graphql/blob/develop/src/graphql/schema/Climb.gql#L115), and style and attempts types defined in the [TickSchema](https://github.com/OpenBeta/openbeta-graphql/blob/develop/src/db/TickTypes.ts).
19
+
Here are all the possible values for `Climb.type` (also called discipline), as defined in the [Climb Schema](https://github.com/OpenBeta/openbeta-graphql/blob/develop/src/graphql/schema/Climb.gql#L115), and Tick style and attemptsTypes defined in the [TickSchema](https://github.com/OpenBeta/openbeta-graphql/blob/develop/src/db/TickTypes.ts).
20
20
21
21
| Climb.type | Tick.style | Tick.attemptType |
22
22
|---------------|------------|------------------|
23
-
| trad | Lead | Onsight |
24
-
| sport | Follow | Flash |
25
-
| bouldering | TR | Redpoint |
26
-
| deepwatersolo | Solo | Pinkpoint |
27
-
| snow | Aid | Send |
28
-
| ice | Boulder | Attempt |
29
-
| aid |Frenchfree ||
30
-
| tr ||
31
-
| alpine ||
32
-
| mixed ||
23
+
| trad | Lead | Onsight |
24
+
| sport | Follow | Flash |
25
+
| bouldering | TR | Redpoint |
26
+
| deepwatersolo | Solo | Pinkpoint |
27
+
| snow | Aid | Send |
28
+
| ice | Boulder | Attempt |
29
+
| aid || Frenchfree |
30
+
| tr |||
31
+
| alpine |||
32
+
| mixed |||
33
33
34
34
35
35
See the [Wikipedia Glossary of Climbing Terms](https://en.wikipedia.org/wiki/Glossary_of_climbing_terms) for common definitions of all these terms.
36
36
37
-
Given the 10 climb types, 6 styles, and 7 attempt types, there are 10*6*7=**420** diffent ways to "tick" a route.
37
+
Given the 10 climb types, 6 styles, and 7 attempt types, there are `10*6*7=`**420** diffent ways to "tick" a route.*(Thats not even accounting for the fact that a route can be multiple disciplines, eg: boulder & TR, or sport & deepwatersolo. If you really want to get nerdy: with the `2^10=1024` possible discipline combinations, there are a whopping `1024*6*7=`**43,008** ways to tick a route!)*
@@ -48,15 +48,17 @@ Here's a Hierarchical way to restrict values:
48
48
| 'deepwatersolo' or leadable or aidable or topropeable | soloable | Solo |
49
49
| bouldering | boulderable | Boulder |
50
50
51
-
## Tick Style -> Tick Attempt Type
51
+
52
+
Since a route can have multiple disciplines, these options are composable. eg: a route marked as 'trad, aid', is both 'leadable' and 'aidable'. A route that is 'boulder, tr', is both 'boulderable' and 'topropeable'
@@ -65,7 +67,7 @@ Here's a Hierarchical way to restrict values:
65
67
* OB does not use the term "Fell/Hung" for roped climbs, and instead normalizes it to "Attempt", just like boulders. Importing routes from MP will convert "Fell/Hung" to "Attempt"
66
68
* While 'Frenchfree' and 'Aid' could be considered synomonous, some climbers may want to distinguish, for example, a multipitch route where one pitch was intentionally 'French freed' (Time Wave Zero being a common example), which is distinctly different in character than, eg: aiding the Nose on El Cap.
67
69
* Eventually, it might be cool to allow ticks for individual pitches, but that is not supported right now.
68
-
* Given the 420 possible combination, no simple logical system will perfectly capture every edge case.
70
+
* Given the 43,008 possible combinations, no simple logical system will perfectly capture every edge case.
consttickStyle=tick.style??'null'// Provide a default value if tick.style is undefined
89
+
90
+
// Tick validation logic is complicated. see [tick_logic.md](https://github.com/OpenBeta/openbeta-graphql/blob/develop/documentation/tick_logic.md).
91
+
92
+
consttickStyle=tick.style??'null'// Provide a default value if tick.style is undefined. This 'null' string is not saved in the db, but used for easy validation.
115
93
constattemptType=tick.attemptType??'null'// Provide a default value if tick.attempy is undefined
116
-
if(isDWSOnly||isBoulderingOnly){// bouldering and dws can only have attempt types: 'Send', 'Flash', 'Attempt', 'Onsight' and should have no sytle
0 commit comments