Renamed ambiguous Notes classes
This commit is contained in:
1 parent
63c0688886
commit
f43817efd0
14 files changed
+142
-170
No files matched your search
@@ -25,73 +25,73 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
{
|
||||
public class CNotes
|
||||
{
|
||||
private readonly List<CLines> _Lines = new List<CLines>();
|
||||
private readonly List<CVoice> _Voices = new List<CVoice>();
|
||||
|
||||
public CLines[] Lines
|
||||
public CVoice[] Voices
|
||||
{
|
||||
get { return _Lines.ToArray(); }
|
||||
get { return _Voices.ToArray(); }
|
||||
}
|
||||
|
||||
public CNotes() {}
|
||||
|
||||
public int LinesCount
|
||||
{
|
||||
get { return _Lines.Count; }
|
||||
get { return _Voices.Count; }
|
||||
}
|
||||
|
||||
public CNotes(CNotes notes)
|
||||
{
|
||||
foreach (CLines lines in notes._Lines)
|
||||
_Lines.Add(new CLines(lines));
|
||||
foreach (CVoice voice in notes._Voices)
|
||||
_Voices.Add(new CVoice(voice));
|
||||
}
|
||||
|
||||
public CLines GetLines(int index)
|
||||
public CVoice GetVoice(int index)
|
||||
{
|
||||
while (index >= _Lines.Count)
|
||||
_Lines.Add(new CLines());
|
||||
while (index >= _Voices.Count)
|
||||
_Voices.Add(new CVoice());
|
||||
|
||||
return _Lines[index];
|
||||
return _Voices[index];
|
||||
}
|
||||
|
||||
public int GetPoints(int index)
|
||||
{
|
||||
if (index >= _Lines.Count)
|
||||
if (index >= _Voices.Count)
|
||||
return 0;
|
||||
|
||||
return _Lines[index].Points;
|
||||
return _Voices[index].Points;
|
||||
}
|
||||
|
||||
public int GetNumLinesWithPoints(int index)
|
||||
{
|
||||
if (index >= _Lines.Count)
|
||||
if (index >= _Voices.Count)
|
||||
return 0;
|
||||
|
||||
return _Lines[index].NumLinesWithPoints;
|
||||
return _Voices[index].NumLinesWithPoints;
|
||||
}
|
||||
|
||||
public void AddLines(CLines lines)
|
||||
public void AddVoice(CVoice voice)
|
||||
{
|
||||
_Lines.Add(lines);
|
||||
_Voices.Add(voice);
|
||||
}
|
||||
|
||||
public bool ReplaceLinesAt(int index, CLines lines)
|
||||
public bool ReplaceVoiceAt(int index, CVoice voice)
|
||||
{
|
||||
if (index >= _Lines.Count)
|
||||
if (index >= _Voices.Count)
|
||||
return false;
|
||||
|
||||
_Lines[index] = lines;
|
||||
_Voices[index] = voice;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_Lines.Clear();
|
||||
_Voices.Clear();
|
||||
}
|
||||
|
||||
public void SetMedley(int startBeat, int endBeat)
|
||||
{
|
||||
foreach (CLines lines in _Lines)
|
||||
lines.SetMedley(startBeat, endBeat);
|
||||
foreach (CVoice voice in _Voices)
|
||||
voice.SetMedley(startBeat, endBeat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,23 +542,23 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
#endregion Methods
|
||||
}
|
||||
|
||||
public class CLines
|
||||
public class CVoice
|
||||
{
|
||||
private readonly List<CLine> _Lines = new List<CLine>();
|
||||
|
||||
public CLines() {}
|
||||
public CVoice() {}
|
||||
|
||||
public CLines(CLines lines)
|
||||
public CVoice(CVoice voice)
|
||||
{
|
||||
foreach (CLine line in lines._Lines)
|
||||
foreach (CLine line in voice._Lines)
|
||||
_Lines.Add(new CLine(line));
|
||||
}
|
||||
|
||||
public CLine[] Line
|
||||
public CLine[] Lines
|
||||
{
|
||||
get { return _Lines.ToArray(); }
|
||||
}
|
||||
public int LineCount
|
||||
public int NumLines
|
||||
{
|
||||
get { return _Lines.Count; }
|
||||
}
|
||||
@@ -577,22 +577,13 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
int endbeat = _Lines.Min(line => line.LastNoteBeat);
|
||||
|
||||
int result = endbeat - startbeat;
|
||||
if (result > 0)
|
||||
return result;
|
||||
|
||||
return 0;
|
||||
return result > 0 ? result : 0;
|
||||
}
|
||||
}
|
||||
|
||||
public int Points
|
||||
{
|
||||
get
|
||||
{
|
||||
int points = 0;
|
||||
foreach (CLine line in _Lines)
|
||||
points += line.Points;
|
||||
return points;
|
||||
}
|
||||
get { return _Lines.Sum(line => line.Points); }
|
||||
}
|
||||
|
||||
public int NumLinesWithPoints
|
||||
|
||||
@@ -224,24 +224,24 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return notes.ID;
|
||||
}
|
||||
|
||||
public void AddLine(int id, CLine[] line, int lineNr)
|
||||
public void SetLines(int id, CLine[] lines, int lineNr)
|
||||
{
|
||||
if (line == null)
|
||||
if (lines == null)
|
||||
return;
|
||||
|
||||
int n = _FindPlayerLine(id);
|
||||
int n = _FindPlayerNotes(id);
|
||||
if (n == -1)
|
||||
return;
|
||||
|
||||
if (lineNr == _PlayerNotes[n].LineNr)
|
||||
return;
|
||||
|
||||
if (line.Length <= lineNr)
|
||||
if (lines.Length <= lineNr)
|
||||
return;
|
||||
|
||||
SPlayerNotes notes = _PlayerNotes[n];
|
||||
|
||||
notes.Lines = line;
|
||||
notes.Lines = lines;
|
||||
notes.LineNr = lineNr;
|
||||
notes.GoldenStars.Clear();
|
||||
notes.Flares.Clear();
|
||||
@@ -253,7 +253,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
public void SetAlpha(int id, float alpha)
|
||||
{
|
||||
int n = _FindPlayerLine(id);
|
||||
int n = _FindPlayerNotes(id);
|
||||
if (n == -1)
|
||||
return;
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
|
||||
public float GetAlpha(int id)
|
||||
{
|
||||
int n = _FindPlayerLine(id);
|
||||
int n = _FindPlayerNotes(id);
|
||||
if (n == -1)
|
||||
return 0f;
|
||||
|
||||
@@ -276,9 +276,9 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
Draw(id, null, player);
|
||||
}
|
||||
|
||||
public void Draw(int id, List<CLine> singLine, int player)
|
||||
public void Draw(int id, List<CLine> singLines, int player)
|
||||
{
|
||||
int n = _FindPlayerLine(id);
|
||||
int n = _FindPlayerNotes(id);
|
||||
if (n == -1)
|
||||
return;
|
||||
|
||||
@@ -357,7 +357,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
foreach (CParticleEffect perfline in _PlayerNotes[n].PerfectLineTwinkle)
|
||||
perfline.Draw();
|
||||
|
||||
if (singLine == null || singLine.Count == 0 || CBase.Game.GetPlayers()[player].CurrentLine == -1 || singLine.Count <= CBase.Game.GetPlayers()[player].CurrentLine)
|
||||
if (singLines == null || singLines.Count == 0 || CBase.Game.GetPlayers()[player].CurrentLine == -1 || singLines.Count <= CBase.Game.GetPlayers()[player].CurrentLine)
|
||||
{
|
||||
foreach (CParticleEffect stars in _PlayerNotes[n].GoldenStars)
|
||||
{
|
||||
@@ -367,7 +367,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (CNote note in singLine[CBase.Game.GetPlayers()[player].CurrentLine].Notes)
|
||||
foreach (CNote note in singLines[CBase.Game.GetPlayers()[player].CurrentLine].Notes)
|
||||
{
|
||||
if (note.StartBeat >= line.FirstNoteBeat && note.EndBeat <= line.LastNoteBeat)
|
||||
{
|
||||
@@ -456,7 +456,7 @@ namespace VocaluxeLib.Menu.SingNotes
|
||||
LoadTextures();
|
||||
}
|
||||
|
||||
private int _FindPlayerLine(int id)
|
||||
private int _FindPlayerNotes(int id)
|
||||
{
|
||||
for (int i = 0; i < _PlayerNotes.Count; i++)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user