From 46c12db8575ea07a7760bd28690fd3aaa4fa07c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 15 Sep 2013 16:36:53 +0200 Subject: [PATCH] Save points also to notes. --- Vocaluxe/Base/CGame.cs | 8 ++++++-- VocaluxeLib/Songs/CSungLine.cs | 2 ++ VocaluxeLib/Songs/CSungNote.cs | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index 9acd1881..f66e0409 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -290,12 +290,15 @@ namespace Vocaluxe.Base { CSungNote lastNote = Players[p].SungLines[line].LastNote; 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 + { Players[p].SungLines[line].IncLastNoteLength(); + Players[p].SungLines[line].LastNote.Points += points; + } } 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].IsPerfect(lines[line]); @@ -336,6 +339,7 @@ namespace Vocaluxe.Base double points = CSettings.LinebonusScore * factor * 1f / numLinesWithPoints; Players[p].Points += points; Players[p].PointsLineBonus += points; + Players[p].SungLines[line].BonusPoints = points; } } } diff --git a/VocaluxeLib/Songs/CSungLine.cs b/VocaluxeLib/Songs/CSungLine.cs index 1f53c719..b268035b 100644 --- a/VocaluxeLib/Songs/CSungLine.cs +++ b/VocaluxeLib/Songs/CSungLine.cs @@ -23,6 +23,8 @@ namespace VocaluxeLib.Songs { public class CSungLine : CLineBase { + public double BonusPoints; + // for drawing perfect line effect public bool PerfectLine { get; set; } diff --git a/VocaluxeLib/Songs/CSungNote.cs b/VocaluxeLib/Songs/CSungNote.cs index 40fbef2e..dfb95395 100644 --- a/VocaluxeLib/Songs/CSungNote.cs +++ b/VocaluxeLib/Songs/CSungNote.cs @@ -43,12 +43,14 @@ namespace VocaluxeLib.Songs /// /// /// - 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; + Points = points; } #region Properties + public double Points; // for drawing player notes public bool Hit {