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
+17
-11
@@ -25,13 +25,13 @@ namespace VocaluxeLib.Game
|
||||
|
||||
public CPoints(int numRounds, SPlayer[] players)
|
||||
{
|
||||
_Rounds = new SPlayer[numRounds,players.Length];
|
||||
_Rounds = new SPlayer[numRounds, players.Length];
|
||||
|
||||
for (int round = 0; round < numRounds; round++)
|
||||
for (var round = 0; round < numRounds; round++)
|
||||
{
|
||||
for (int player = 0; player < players.Length; player++)
|
||||
for (var player = 0; player < players.Length; player++)
|
||||
{
|
||||
_Rounds[round, player].ProfileID = players[player].ProfileID;
|
||||
_Rounds[round, player].ProfileId = players[player].ProfileId;
|
||||
_Rounds[round, player].Points = 0f;
|
||||
_Rounds[round, player].PointsGoldenNotes = 0f;
|
||||
_Rounds[round, player].PointsLineBonus = 0f;
|
||||
@@ -41,12 +41,12 @@ namespace VocaluxeLib.Game
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPoints(int round, int songID, SPlayer[] players, EGameMode gameMode)
|
||||
public void SetPoints(int round, int songId, SPlayer[] players, EGameMode gameMode)
|
||||
{
|
||||
long dateTicks = DateTime.Now.Ticks;
|
||||
for (int player = 0; player < players.Length; player++)
|
||||
var dateTicks = DateTime.Now.Ticks;
|
||||
for (var player = 0; player < players.Length; player++)
|
||||
{
|
||||
_Rounds[round, player].SongID = songID;
|
||||
_Rounds[round, player].SongId = songId;
|
||||
_Rounds[round, player].VoiceNr = players[player].VoiceNr;
|
||||
_Rounds[round, player].Points = players[player].Points;
|
||||
_Rounds[round, player].PointsGoldenNotes = players[player].PointsGoldenNotes;
|
||||
@@ -70,24 +70,30 @@ namespace VocaluxeLib.Game
|
||||
public SPlayer[] GetPlayer(int round, int numPlayer)
|
||||
{
|
||||
if (NumPlayer == 0)
|
||||
{
|
||||
return new SPlayer[1];
|
||||
}
|
||||
|
||||
if (round >= NumRounds)
|
||||
{
|
||||
return new SPlayer[1];
|
||||
}
|
||||
|
||||
var players = new SPlayer[numPlayer];
|
||||
|
||||
for (int p = 0; p < players.Length; p++)
|
||||
for (var p = 0; p < players.Length; p++)
|
||||
{
|
||||
players[p].Points = _Rounds[round, p].Points;
|
||||
players[p].PointsGoldenNotes = _Rounds[round, p].PointsGoldenNotes;
|
||||
players[p].PointsLineBonus = _Rounds[round, p].PointsLineBonus;
|
||||
players[p].SongID = _Rounds[round, p].SongID;
|
||||
players[p].SongId = _Rounds[round, p].SongId;
|
||||
players[p].VoiceNr = _Rounds[round, p].VoiceNr;
|
||||
players[p].GameMode = _Rounds[round, p].GameMode;
|
||||
players[p].DateTicks = _Rounds[round, p].DateTicks;
|
||||
players[p].SongFinished = _Rounds[round, p].SongFinished;
|
||||
players[p].ProfileID = _Rounds[round, p].ProfileID;
|
||||
players[p].ProfileId = _Rounds[round, p].ProfileId;
|
||||
}
|
||||
|
||||
return players;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user