Apply R# clean-up for reliability (#877)
* Apply R# clean-up for reliability - Migrate to NUnit4 Assert.That - Update dependencise versions - Fix LangVersion to 9.0 (until net core migration) - Reformat code - Apply 'var' style (easier for refactoring) - Remove redundant parentheses - Add braces on every condition blocks (1 line) - Uses new null checking patterns - Uses AutoProperties when possible - Uses string scalar type instead of class - Clean usings - Add .orig files in git ignore - Rename some properties to respect defined conventions and US format definition - ID -> Id - BPM -> Bpm - Finish -> End * Update R# settings according to the clean-up made
This commit is contained in:
1 parent
b9b0f7c8df
commit
6ffa63b923
236 files changed
+14194
-7278
No files matched your search
@@ -23,20 +23,16 @@ namespace VocaluxeLib.PartyModes
|
||||
{
|
||||
public abstract class CPartyMode : IPartyMode
|
||||
{
|
||||
private readonly int _ID;
|
||||
protected SScreenSongOptions _ScreenSongOptions = new SScreenSongOptions {Selection = new SSelectionOptions(), Sorting = new SSortingOptions()};
|
||||
protected SScreenSongOptions _ScreenSongOptions = new SScreenSongOptions { Selection = new SSelectionOptions(), Sorting = new SSortingOptions() };
|
||||
protected readonly Dictionary<string, CMenuParty> _Screens = new Dictionary<string, CMenuParty>();
|
||||
|
||||
protected CPartyMode(int id)
|
||||
{
|
||||
_ID = id;
|
||||
Id = id;
|
||||
}
|
||||
|
||||
#region Implementation
|
||||
public int ID
|
||||
{
|
||||
get { return _ID; }
|
||||
}
|
||||
public int Id { get; }
|
||||
|
||||
public int NumPlayers { get; set; }
|
||||
public int NumTeams { get; set; }
|
||||
@@ -55,8 +51,8 @@ namespace VocaluxeLib.PartyModes
|
||||
|
||||
public void LoadTheme()
|
||||
{
|
||||
string xmlPath = CBase.Themes.GetThemeScreensPath(ID);
|
||||
foreach (CMenuParty menu in _Screens.Values)
|
||||
var xmlPath = CBase.Themes.GetThemeScreensPath(Id);
|
||||
foreach (var menu in _Screens.Values)
|
||||
{
|
||||
menu.Init();
|
||||
menu.LoadTheme(xmlPath);
|
||||
@@ -65,15 +61,19 @@ namespace VocaluxeLib.PartyModes
|
||||
|
||||
public void ReloadSkin()
|
||||
{
|
||||
foreach (CMenuParty menu in _Screens.Values)
|
||||
foreach (var menu in _Screens.Values)
|
||||
{
|
||||
menu.ReloadSkin();
|
||||
}
|
||||
}
|
||||
|
||||
public void ReloadTheme()
|
||||
{
|
||||
string xmlPath = CBase.Themes.GetThemeScreensPath(ID);
|
||||
foreach (CMenuParty menu in _Screens.Values)
|
||||
var xmlPath = CBase.Themes.GetThemeScreensPath(Id);
|
||||
foreach (var menu in _Screens.Values)
|
||||
{
|
||||
menu.ReloadTheme(xmlPath);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddScreen(CMenuParty screen, string screenName)
|
||||
@@ -83,20 +83,28 @@ namespace VocaluxeLib.PartyModes
|
||||
|
||||
public void SaveScreens()
|
||||
{
|
||||
foreach (KeyValuePair<string, CMenuParty> entry in _Screens)
|
||||
foreach (var entry in _Screens)
|
||||
{
|
||||
entry.Value.SaveTheme();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void JokerUsed(int teamNr)
|
||||
{
|
||||
if (_ScreenSongOptions.Selection.NumJokers == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_ScreenSongOptions.Selection.NumJokers.Length < teamNr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_ScreenSongOptions.Selection.NumJokers[teamNr] > 0)
|
||||
{
|
||||
_ScreenSongOptions.Selection.NumJokers[teamNr]--;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void FinishedSinging()
|
||||
@@ -132,7 +140,7 @@ namespace VocaluxeLib.PartyModes
|
||||
public abstract void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions);
|
||||
public abstract void SetSearchString(string searchString, bool visible);
|
||||
|
||||
public abstract void SongSelected(int songID);
|
||||
public abstract void SongSelected(int songId);
|
||||
#endregion Abstract members
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user