forked from YARC-Official/YARG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up/re-organize note types and add some new things to them (YARC…
…-Official#27) * Rework chart event constructor parameters - Reorganize note parameters to better follow class hierarchy - Remove previousNote parameter, it's not really that useful - Remove text event length parameters * Reorganize note flags - Move instrument-specific note flags to their respective types - Change values to use `1 << x` instead of raw values - Move IsChord to Note, and base it off of the child note count instead of a flag - Add missing properties for flags * Tidy up chart event fields and properties - Reordered by modifiers: private first, public last - Aligned everything in columns * Fix child notes list not getting created * Add guitar/drums note value definitions and vocals harmony part value Removed the drums cymbal flag, it's now part of the note value * Add note type values to guitar/drum notes * Add SP activator flag to drum notes * Add Pro Guitar note * (Re-)Add convenience properties for note types * Allow publically setting note type values * Simplify guitar/Pro guitar IsSustain property
- Loading branch information
1 parent
c6e8119
commit 489541f
Showing
7 changed files
with
228 additions
and
95 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
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 |
---|---|---|
@@ -1,18 +1,79 @@ | ||
namespace YARG.Core.Chart | ||
using System; | ||
|
||
namespace YARG.Core.Chart | ||
{ | ||
public class DrumNote : Note | ||
{ | ||
private readonly DrumNoteFlags _drumFlags; | ||
|
||
public int Pad { get; } | ||
|
||
public bool IsCymbal => (_flags & NoteFlags.Cymbal) != 0; | ||
public DrumNoteType Type { get; set; } | ||
|
||
public bool IsGhost => (_flags & NoteFlags.DrumGhost) != 0; | ||
public bool IsAccent => (_flags & NoteFlags.DrumAccent) != 0; | ||
public bool IsNeutral => Type == DrumNoteType.Neutral; | ||
public bool IsAccent => Type == DrumNoteType.Accent; | ||
public bool IsGhost => Type == DrumNoteType.Ghost; | ||
|
||
public DrumNote(Note previousNote, double time, uint tick, int pad, NoteFlags flags) | ||
: base(previousNote, time, 0, tick, 0, flags) | ||
public bool IsStarPowerActivator => (_drumFlags & DrumNoteFlags.StarPowerActivator) != 0; | ||
|
||
public DrumNote(FourLaneDrumPad pad, DrumNoteType noteType, DrumNoteFlags drumFlags, | ||
NoteFlags flags, double time, uint tick) | ||
: this((int)pad, noteType, drumFlags, flags, time, tick) | ||
{ | ||
} | ||
|
||
public DrumNote(FiveLaneDrumPad pad, DrumNoteType noteType, DrumNoteFlags drumFlags, | ||
NoteFlags flags, double time, uint tick) | ||
: this((int)pad, noteType, drumFlags, flags, time, tick) | ||
{ | ||
} | ||
|
||
public DrumNote(int pad, DrumNoteType noteType, DrumNoteFlags drumFlags, NoteFlags flags, double time, uint tick) | ||
: base(flags, time, 0, tick, 0) | ||
{ | ||
Pad = pad; | ||
Type = noteType; | ||
_drumFlags = drumFlags; | ||
} | ||
} | ||
|
||
public enum FourLaneDrumPad | ||
{ | ||
Kick, | ||
|
||
RedDrum, | ||
YellowDrum, | ||
BlueDrum, | ||
GreenDrum, | ||
|
||
YellowCymbal, | ||
BlueCymbal, | ||
GreenCymbal, | ||
} | ||
|
||
public enum FiveLaneDrumPad | ||
{ | ||
Kick, | ||
|
||
Red, | ||
Yellow, | ||
Blue, | ||
Orange, | ||
Green, | ||
} | ||
|
||
public enum DrumNoteType | ||
{ | ||
Neutral, | ||
Ghost, | ||
Accent, | ||
} | ||
|
||
[Flags] | ||
public enum DrumNoteFlags | ||
{ | ||
None = 0, | ||
|
||
StarPowerActivator = 1 << 0, | ||
} | ||
} |
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
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,54 @@ | ||
using System; | ||
|
||
namespace YARG.Core.Chart | ||
{ | ||
public class ProGuitarNote : Note | ||
{ | ||
private readonly ProGuitarNoteFlags _proFlags; | ||
|
||
public int String { get; } | ||
public int Fret { get; } | ||
|
||
public ProGuitarNoteType Type { get; set; } | ||
|
||
public bool IsStrum => Type == ProGuitarNoteType.Strum; | ||
public bool IsHopo => Type == ProGuitarNoteType.Hopo; | ||
public bool IsTap => Type == ProGuitarNoteType.Tap; | ||
|
||
public bool IsSustain => TickLength > 0; | ||
|
||
public bool IsExtendedSustain => (_proFlags & ProGuitarNoteFlags.ExtendedSustain) != 0; | ||
public bool IsDisjoint => (_proFlags & ProGuitarNoteFlags.Disjoint) != 0; | ||
|
||
public bool IsMuted => (_proFlags & ProGuitarNoteFlags.Muted) != 0; | ||
|
||
public ProGuitarNote(int stringNo, int fret, ProGuitarNoteType type, ProGuitarNoteFlags proFlags, | ||
NoteFlags flags, double time, double timeLength, uint tick, uint tickLength) | ||
: base(flags, time, timeLength, tick, tickLength) | ||
{ | ||
String = stringNo; | ||
Fret = fret; | ||
Type = type; | ||
|
||
_proFlags = proFlags; | ||
} | ||
} | ||
|
||
public enum ProGuitarNoteType | ||
{ | ||
Strum, | ||
Hopo, | ||
Tap, | ||
} | ||
|
||
[Flags] | ||
public enum ProGuitarNoteFlags | ||
{ | ||
None = 0, | ||
|
||
ExtendedSustain = 1 << 0, | ||
Disjoint = 1 << 1, | ||
|
||
Muted = 1 << 2, | ||
} | ||
} |
Oops, something went wrong.