removed namespace Base from CNotes, some simplifications
This commit is contained in:
1 parent
da7fb490a8
commit
ded087967d
7 files changed
+40
-27
No files matched your search
@@ -315,7 +315,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
CNote nt = _Player[p].SingLine[Line].LastNote;
|
||||
if (notes[Note].StartBeat == beat || nt.EndBeat + 1 != beat || nt.Tone != Tone)
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, Tone, String.Empty, true, notes[Note].NoteType));
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, Tone, String.Empty, true, notes[Note].NoteType));
|
||||
else
|
||||
{
|
||||
_Player[p].SingLine[Line].IncLastNoteLength();
|
||||
@@ -323,7 +323,7 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
else
|
||||
{
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, Tone, String.Empty, true, notes[Note].NoteType));
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, Tone, String.Empty, true, notes[Note].NoteType));
|
||||
}
|
||||
|
||||
_Player[p].SingLine[Line].LastNote.IsPerfect(notes[Note]);
|
||||
@@ -335,7 +335,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
CNote nt = _Player[p].SingLine[Line].LastNote;
|
||||
if (nt.EndBeat + 1 != beat || nt.Hit)
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
|
||||
else
|
||||
{
|
||||
if (nt.Tone == TonePlayer && nt.EndBeat + 1 == beat)
|
||||
@@ -344,13 +344,13 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
else
|
||||
{
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
|
||||
_Player[p].SingLine[Line].AddNote(new CNote(CMain.Base, beat, 1, TonePlayer, String.Empty, false, ENoteType.Freestyle));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -280,16 +280,14 @@ namespace Vocaluxe.Menu
|
||||
for (int i = 0; i < _Screens.Count; i++)
|
||||
{
|
||||
CLog.StartBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]);
|
||||
_Screens[i].Initialize(CMain.Config, CMain.Settings, CMain.Theme, CMain.Helper, CMain.Log, CMain.BackgroundMusic, CMain.Draw,
|
||||
CMain.Graphics, CMain.Fonts, CMain.Language, CMain.Game, CMain.Profiles);
|
||||
_Screens[i].Initialize(CMain.Base);
|
||||
_Screens[i].LoadTheme();
|
||||
CLog.StopBenchmark(1, "Load Theme " + Enum.GetNames(typeof(EScreens))[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < _PopupScreens.Count; i++)
|
||||
{
|
||||
_PopupScreens[i].Initialize(CMain.Config, CMain.Settings, CMain.Theme, CMain.Helper, CMain.Log, CMain.BackgroundMusic, CMain.Draw,
|
||||
CMain.Graphics, CMain.Fonts, CMain.Language, CMain.Game, CMain.Profiles);
|
||||
_PopupScreens[i].Initialize(CMain.Base);
|
||||
_PopupScreens[i].LoadTheme();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace Vocaluxe.Base
|
||||
public static ILanguage Language = new BLanguage();
|
||||
public static IGame Game = new BGame();
|
||||
public static IProfiles Profiles = new BProfiles();
|
||||
|
||||
public static Menu.Base Base = new Menu.Base(Config, Settings, Theme, Helper, Log, BackgroundMusic, Draw, Graphics, Fonts, Language, Game, Profiles);
|
||||
}
|
||||
|
||||
class BConfig : IConfig
|
||||
@@ -89,6 +91,16 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
return CSettings.GameState;
|
||||
}
|
||||
|
||||
public int GetToneMin()
|
||||
{
|
||||
return CSettings.ToneMin;
|
||||
}
|
||||
|
||||
public int GetToneMax()
|
||||
{
|
||||
return CSettings.ToneMax;
|
||||
}
|
||||
}
|
||||
|
||||
class BTheme : ITheme
|
||||
|
||||
@@ -744,7 +744,7 @@ namespace Vocaluxe.Lib.Song
|
||||
|
||||
private void ParseNote(int Player, ENoteType NoteType, int Start, int Length, int Tone, string Text)
|
||||
{
|
||||
CNote note = new CNote(Start, Length, Tone, Text, NoteType);
|
||||
CNote note = new CNote(CMain.Base, Start, Length, Tone, Text, NoteType);
|
||||
CLines lines = this.Notes.GetLines(Player);
|
||||
|
||||
if (lines.LineCount == 0)
|
||||
|
||||
@@ -93,13 +93,12 @@ namespace Vocaluxe.Menu
|
||||
}
|
||||
|
||||
public CMenu()
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
public void Initialize(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic, IDrawing Draw,
|
||||
IGraphics Graphics, IFonts Fonts, ILanguage Language, IGame Game, IProfiles Profiles)
|
||||
public void Initialize(Base Base)
|
||||
{
|
||||
_Base = new Base(Config, Settings, Theme, Helper, Log, BackgroundMusic, Draw, Graphics, Fonts, Language, Game, Profiles);
|
||||
_Base = Base;
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ namespace Vocaluxe.Menu
|
||||
{
|
||||
interface IMenu
|
||||
{
|
||||
void Initialize(IConfig Config, ISettings Settings, ITheme Theme, IHelper Helper, ILog Log, IBackgroundMusic BackgroundMusic, IDrawing Draw,
|
||||
IGraphics Graphics, IFonts Fonts, ILanguage Language, IGame Game, IProfiles Profiles);
|
||||
void Initialize(Base Base);
|
||||
|
||||
void LoadTheme();
|
||||
void SaveTheme();
|
||||
@@ -64,6 +63,9 @@ namespace Vocaluxe.Menu
|
||||
float GetZNear();
|
||||
|
||||
EGameState GetGameState();
|
||||
|
||||
int GetToneMin();
|
||||
int GetToneMax();
|
||||
}
|
||||
|
||||
public interface ITheme
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using Vocaluxe.Base;
|
||||
using Vocaluxe.Menu;
|
||||
|
||||
namespace Vocaluxe.Menu.SingNotes
|
||||
@@ -84,6 +83,7 @@ namespace Vocaluxe.Menu.SingNotes
|
||||
|
||||
public class CNote
|
||||
{
|
||||
private Base _Base;
|
||||
private int _StartBeat;
|
||||
private int _Duration;
|
||||
private int _Tone;
|
||||
@@ -93,8 +93,9 @@ namespace Vocaluxe.Menu.SingNotes
|
||||
private bool _Perfect; // for drawing perfect note effect
|
||||
|
||||
#region Contructors
|
||||
public CNote()
|
||||
public CNote(Base Base)
|
||||
{
|
||||
_Base = Base;
|
||||
StartBeat = 0;
|
||||
Duration = 1;
|
||||
Tone = 0;
|
||||
@@ -106,6 +107,7 @@ namespace Vocaluxe.Menu.SingNotes
|
||||
|
||||
public CNote(CNote note)
|
||||
{
|
||||
_Base = note._Base;
|
||||
_StartBeat = note._StartBeat;
|
||||
_Duration = note._Duration;
|
||||
_Tone = note._Tone;
|
||||
@@ -115,8 +117,8 @@ namespace Vocaluxe.Menu.SingNotes
|
||||
_Perfect = note._Perfect;
|
||||
}
|
||||
|
||||
public CNote(int StartBeat, int Duration, int Tone, string Text)
|
||||
: this()
|
||||
public CNote(Base Base, int StartBeat, int Duration, int Tone, string Text)
|
||||
: this(Base)
|
||||
{
|
||||
this.StartBeat = StartBeat;
|
||||
this.Duration = Duration;
|
||||
@@ -125,8 +127,8 @@ namespace Vocaluxe.Menu.SingNotes
|
||||
this.Text = Text;
|
||||
}
|
||||
|
||||
public CNote(int StartBeat, int Duration, int Tone, string Text, bool Hit)
|
||||
: this()
|
||||
public CNote(Base Base, int StartBeat, int Duration, int Tone, string Text, bool Hit)
|
||||
: this(Base)
|
||||
{
|
||||
this.StartBeat = StartBeat;
|
||||
this.Duration = Duration;
|
||||
@@ -136,14 +138,14 @@ namespace Vocaluxe.Menu.SingNotes
|
||||
this.Hit = Hit;
|
||||
}
|
||||
|
||||
public CNote(int StartBeat, int Duration, int Tone, string Text, ENoteType NoteType)
|
||||
: this(StartBeat, Duration, Tone, Text)
|
||||
public CNote(Base Base, int StartBeat, int Duration, int Tone, string Text, ENoteType NoteType)
|
||||
: this(Base, StartBeat, Duration, Tone, Text)
|
||||
{
|
||||
this.NoteType = NoteType;
|
||||
}
|
||||
|
||||
public CNote(int StartBeat, int Duration, int Tone, string Text, bool Hit, ENoteType NoteType)
|
||||
: this(StartBeat, Duration, Tone, Text)
|
||||
public CNote(Base Base, int StartBeat, int Duration, int Tone, string Text, bool Hit, ENoteType NoteType)
|
||||
: this(Base, StartBeat, Duration, Tone, Text)
|
||||
{
|
||||
this.NoteType = NoteType;
|
||||
this.Hit = Hit;
|
||||
@@ -192,7 +194,7 @@ namespace Vocaluxe.Menu.SingNotes
|
||||
get { return _Tone; }
|
||||
set
|
||||
{
|
||||
if ((value >= CSettings.ToneMin) && (value <= CSettings.ToneMax))
|
||||
if ((value >= _Base.Settings.GetToneMin()) && (value <= _Base.Settings.GetToneMax()))
|
||||
_Tone = value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user