Skip to content

Commit

Permalink
Added methods for incrementing Accidentals value
Browse files Browse the repository at this point in the history
  • Loading branch information
albertms10 committed Jun 7, 2020
1 parent e1de2af commit 54c107e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/enums/accidentals.dart
Expand Up @@ -42,4 +42,9 @@ extension AccidentalsValues on Accidentals {
/// Accidentals.DobleSostingut.value == 2
/// ```
int get value => accidentalValues[this];

Accidentals get incremented => increment(1);

Accidentals increment(int n) =>
fromValue(value.abs() + n * (value > 0 ? 1 : -1));
}

0 comments on commit 54c107e

Please sign in to comment.