Save points also to notes.

This commit is contained in:
Florian Küpper committed 2013-09-15 16:36:53 +02:00
1 parent 808c52d471
commit 46c12db857
3 files changed
+11 -3

No files matched your search

+6 -2
View File
@@ -290,12 +290,15 @@ namespace Vocaluxe.Base
{ {
CSungNote lastNote = Players[p].SungLines[line].LastNote; CSungNote lastNote = Players[p].SungLines[line].LastNote;
if (notes[note].StartBeat == beat || lastNote.EndBeat + 1 != beat || lastNote.Tone != tone || !lastNote.Hit) if (notes[note].StartBeat == beat || lastNote.EndBeat + 1 != beat || lastNote.Tone != tone || !lastNote.Hit)
Players[p].SungLines[line].AddNote(new CSungNote(beat, 1, tone, notes[note])); Players[p].SungLines[line].AddNote(new CSungNote(beat, 1, tone, notes[note], points));
else else
{
Players[p].SungLines[line].IncLastNoteLength(); Players[p].SungLines[line].IncLastNoteLength();
Players[p].SungLines[line].LastNote.Points += points;
}
} }
else else
Players[p].SungLines[line].AddNote(new CSungNote(beat, 1, tone, notes[note])); Players[p].SungLines[line].AddNote(new CSungNote(beat, 1, tone, notes[note], points));
Players[p].SungLines[line].LastNote.CheckPerfect(); Players[p].SungLines[line].LastNote.CheckPerfect();
Players[p].SungLines[line].IsPerfect(lines[line]); Players[p].SungLines[line].IsPerfect(lines[line]);
@@ -336,6 +339,7 @@ namespace Vocaluxe.Base
double points = CSettings.LinebonusScore * factor * 1f / numLinesWithPoints; double points = CSettings.LinebonusScore * factor * 1f / numLinesWithPoints;
Players[p].Points += points; Players[p].Points += points;
Players[p].PointsLineBonus += points; Players[p].PointsLineBonus += points;
Players[p].SungLines[line].BonusPoints = points;
} }
} }
} }
+2
View File
@@ -23,6 +23,8 @@ namespace VocaluxeLib.Songs
{ {
public class CSungLine : CLineBase<CSungNote> public class CSungLine : CLineBase<CSungNote>
{ {
public double BonusPoints;
// for drawing perfect line effect // for drawing perfect line effect
public bool PerfectLine { get; set; } public bool PerfectLine { get; set; }
+3 -1
View File
@@ -43,12 +43,14 @@ namespace VocaluxeLib.Songs
/// <param name="duration"></param> /// <param name="duration"></param>
/// <param name="tone"></param> /// <param name="tone"></param>
/// <param name="hitNote"></param> /// <param name="hitNote"></param>
public CSungNote(int startBeat, int duration, int tone, CSongNote hitNote) : this(startBeat, duration, tone) public CSungNote(int startBeat, int duration, int tone, CSongNote hitNote, double points) : this(startBeat, duration, tone)
{ {
HitNote = hitNote; HitNote = hitNote;
Points = points;
} }
#region Properties #region Properties
public double Points;
// for drawing player notes // for drawing player notes
public bool Hit public bool Hit
{ {