Permalink
Browse files

Resharper code cleanup pass of HearthCap.Core project

  • Loading branch information...
1 parent 10dcb41 commit 9c38cf5819ee17234c34bd35429aa854c185bf4a @remcoros remcoros committed Aug 29, 2015
Showing with 1,389 additions and 1,115 deletions.
  1. +212 −230 HearthCap.Core/GameCapture/AutoCaptureEngine.cs
  2. +1 −1 HearthCap.Core/GameCapture/CaptureMethod.cs
  3. +6 −6 HearthCap.Core/GameCapture/EngineEvent.cs
  4. +4 −4 HearthCap.Core/GameCapture/EngineEvents/IncompatibleHooksFound.cs
  5. +2 −2 HearthCap.Core/GameCapture/EngineEvents/WindowFound.cs
  6. +1 −1 HearthCap.Core/GameCapture/EngineEvents/WindowMinimized.cs
  7. +1 −1 HearthCap.Core/GameCapture/EngineEvents/WindowNotFound.cs
  8. +4 −4 HearthCap.Core/GameCapture/EngineSwitchEventArgs.cs
  9. +1 −1 HearthCap.Core/GameCapture/HS/Commands/RequestArenaDeckScreenshot.cs
  10. +1 −1 HearthCap.Core/GameCapture/HS/Commands/RequestDeckScreenshot.cs
  11. +1 −2 HearthCap.Core/GameCapture/HS/Commands/ResetCurrentGame.cs
  12. +5 −5 HearthCap.Core/GameCapture/HS/Events/ArenaDeckScreenshotTaken.cs
  13. +3 −3 HearthCap.Core/GameCapture/HS/Events/ArenaDrafting.cs
  14. +2 −2 HearthCap.Core/GameCapture/HS/Events/ArenaHeroDetected.cs
  15. +2 −2 HearthCap.Core/GameCapture/HS/Events/ArenaLossesDetected.cs
  16. +9 −9 HearthCap.Core/GameCapture/HS/Events/ArenaSessionEnded.cs
  17. +8 −8 HearthCap.Core/GameCapture/HS/Events/ArenaSessionStarted.cs
  18. +2 −2 HearthCap.Core/GameCapture/HS/Events/ArenaWinsDetected.cs
  19. +2 −2 HearthCap.Core/GameCapture/HS/Events/CoinDetected.cs
  20. +3 −3 HearthCap.Core/GameCapture/HS/Events/DeckDetected.cs
  21. +5 −5 HearthCap.Core/GameCapture/HS/Events/DeckScreenshotTaken.cs
  22. +4 −5 HearthCap.Core/GameCapture/HS/Events/GameEnded.cs
  23. +7 −7 HearthCap.Core/GameCapture/HS/Events/GameEvent.cs
  24. +6 −6 HearthCap.Core/GameCapture/HS/Events/GameModeChanged.cs
  25. +10 −11 HearthCap.Core/GameCapture/HS/Events/GameStarted.cs
  26. +4 −4 HearthCap.Core/GameCapture/HS/Events/HeroDetected.cs
  27. +3 −3 HearthCap.Core/GameCapture/HS/Events/NewRound.cs
  28. +4 −4 HearthCap.Core/GameCapture/HS/Events/OpponentHeroDetected.cs
  29. +3 −3 HearthCap.Core/GameCapture/HS/Events/VictoryDetected.cs
  30. +1 −1 HearthCap.Core/GameCapture/HS/Events/WindowInBackground.cs
  31. +145 −84 HearthCap.Core/GameCapture/HS/HSImageScanner.cs
  32. +4 −4 HearthCap.Core/GameCapture/HS/IScanAreaProvider.cs
  33. +7 −7 HearthCap.Core/GameCapture/HS/ResolutionHelper.cs
  34. +12 −41 HearthCap.Core/GameCapture/HS/ScanArea.cs
  35. +26 −25 HearthCap.Core/GameCapture/HS/ScanAreaProvider.cs
  36. +6 −6 HearthCap.Core/GameCapture/HS/ScanAreas.cs
  37. +5 −5 HearthCap.Core/GameCapture/ICaptureEngine.cs
  38. +5 −5 HearthCap.Core/GameCapture/IImageScanner.cs
  39. +107 −124 HearthCap.Core/GameCapture/LogCaptureEngine.cs
  40. +9 −9 HearthCap.Core/GameCapture/Logging/CaptureEngineLogEventArgs.cs
  41. +1 −5 HearthCap.Core/GameCapture/Logging/CaptureEngineLogger.cs
  42. +4 −2 HearthCap.Core/GameCapture/Logging/ICaptureEngineLogger.cs
  43. +33 −14 HearthCap.Core/GameCapture/Logging/LogEvent.cs
  44. +4 −4 HearthCap.Core/GameCapture/Logging/LogEvents/WindowCaptured.cs
  45. +4 −4 HearthCap.Core/GameCapture/Logging/LogLevel.cs
  46. +133 −84 HearthCap.Core/GameCapture/ScanAreaDictionary.cs
  47. +135 −84 HearthCap.Core/GameCapture/ScanAreaImageDictionary.cs
  48. +28 −11 HearthCap.Core/GameCapture/ScreenshotCaptureException.cs
  49. +2 −2 HearthCap.Core/GameCapture/Speeds.cs
  50. +6 −8 HearthCap.Core/GameCapture/TraceLogger.cs
  51. +4 −1 HearthCap.Core/Properties/AssemblyInfo.cs
  52. +109 −75 HearthCap.Core/Util/HearthstoneHelper.cs
  53. +102 −60 HearthCap.Core/Util/ImageUtils.cs
  54. +1 −1 HearthCap.Core/Util/Mostly.cs
  55. +180 −112 HearthCap.Core/Util/ScreenCapture.cs
Oops, something went wrong.
@@ -8,4 +8,4 @@ public enum CaptureMethod
BitBlt,
Log
}
-}
+}
@@ -1,20 +1,20 @@
+using System;
+
namespace HearthCap.Core.GameCapture
{
- using System;
-
public class EngineEvent
{
/// <summary>
- /// Initializes a new instance of the <see cref="T:System.Object"/> class.
+ /// Initializes a new instance of the <see cref="T:System.Object" /> class.
/// </summary>
public EngineEvent(string message)
{
- this.Message = message;
- this.Date = DateTime.Now;
+ Message = message;
+ Date = DateTime.Now;
}
public string Message { get; set; }
public DateTime Date { get; set; }
}
-}
+}
@@ -7,13 +7,13 @@ public class IncompatibleHooksFound : EngineEvent
public string Description { get; set; }
/// <summary>
- /// Initializes a new instance of the <see cref="T:System.Object"/> class.
+ /// Initializes a new instance of the <see cref="T:System.Object" /> class.
/// </summary>
public IncompatibleHooksFound(string hookName, string description)
: base("Incompatible hook found: " + hookName)
{
- this.HookName = hookName;
- this.Description = description;
+ HookName = hookName;
+ Description = description;
}
}
-}
+}
@@ -3,11 +3,11 @@
public class WindowFound : EngineEvent
{
/// <summary>
- /// Initializes a new instance of the <see cref="T:System.Object"/> class.
+ /// Initializes a new instance of the <see cref="T:System.Object" /> class.
/// </summary>
public WindowFound()
: base("Window found.")
{
}
}
-}
+}
@@ -7,4 +7,4 @@ public WindowMinimized()
{
}
}
-}
+}
@@ -7,4 +7,4 @@ public WindowNotFound()
{
}
}
-}
+}
@@ -1,11 +1,11 @@
-namespace HearthCap.Core.GameCapture
-{
- using System;
+using System;
+namespace HearthCap.Core.GameCapture
+{
public class EngineSwitchEventArgs : EventArgs
{
public bool? FullscreenSupport { get; set; }
public bool? BackgroundCaptureSupport { get; set; }
}
-}
+}
@@ -4,4 +4,4 @@ public class RequestArenaDeckScreenshot
{
public bool Cancel { get; set; }
}
-}
+}
@@ -4,4 +4,4 @@ public class RequestDeckScreenshot
{
public bool Cancel { get; set; }
}
-}
+}
@@ -2,6 +2,5 @@
{
public class ResetCurrentGame
{
-
}
-}
+}
@@ -1,14 +1,14 @@
-namespace HearthCap.Core.GameCapture.HS.Events
-{
- using System.Drawing;
+using System.Drawing;
+namespace HearthCap.Core.GameCapture.HS.Events
+{
public class ArenaDeckScreenshotTaken
{
public Bitmap Image { get; protected set; }
public ArenaDeckScreenshotTaken(Bitmap image)
{
- this.Image = image;
+ Image = image;
}
}
-}
+}
@@ -1,12 +1,12 @@
+using HearthCap.Core.GameCapture.HS.Events;
+
namespace HearthCap.Core.GameCapture.HS
{
- using HearthCap.Core.GameCapture.HS.Events;
-
public class ArenaDrafting : GameEvent
{
public ArenaDrafting()
: base("Arena: drafting cards")
{
}
}
-}
+}
@@ -5,9 +5,9 @@ public class ArenaHeroDetected : GameEvent
public ArenaHeroDetected(string hero)
: base("hero detected: " + hero)
{
- this.Hero = hero;
+ Hero = hero;
}
public string Hero { get; protected set; }
}
-}
+}
@@ -8,7 +8,7 @@ public ArenaLossesDetected(int losses)
: base("Losses: " + losses)
{
- this.Losses = losses;
+ Losses = losses;
}
}
-}
+}
@@ -1,7 +1,7 @@
-namespace HearthCap.Core.GameCapture.HS.Events
-{
- using System;
+using System;
+namespace HearthCap.Core.GameCapture.HS.Events
+{
public class ArenaSessionEnded : GameEvent
{
public DateTime Started { get; set; }
@@ -17,11 +17,11 @@ public class ArenaSessionEnded : GameEvent
public ArenaSessionEnded(DateTime started, DateTime ended, string heroKey, int wins, int losses)
: base("Arena ended")
{
- this.Started = started;
- this.Ended = ended;
- this.HeroKey = heroKey;
- this.Wins = wins;
- this.Losses = losses;
+ Started = started;
+ Ended = ended;
+ HeroKey = heroKey;
+ Wins = wins;
+ Losses = losses;
}
}
-}
+}
@@ -1,7 +1,7 @@
-namespace HearthCap.Core.GameCapture.HS.Events
-{
- using System;
+using System;
+namespace HearthCap.Core.GameCapture.HS.Events
+{
public class ArenaSessionStarted : GameEvent
{
public DateTime Started { get; set; }
@@ -15,10 +15,10 @@ public class ArenaSessionStarted : GameEvent
public ArenaSessionStarted(DateTime started, string heroKey, int wins, int losses)
: base("Arena started")
{
- this.Started = started;
- this.HeroKey = heroKey;
- this.Wins = wins;
- this.Losses = losses;
+ Started = started;
+ HeroKey = heroKey;
+ Wins = wins;
+ Losses = losses;
}
}
-}
+}
@@ -7,7 +7,7 @@ public class ArenaWinsDetected : GameEvent
public ArenaWinsDetected(int arenaWins)
: base("Wins: " + arenaWins)
{
- this.Wins = arenaWins;
+ Wins = arenaWins;
}
}
-}
+}
@@ -6,9 +6,9 @@ public class CoinDetected : GameEvent
public CoinDetected(bool goFirst)
: base("Coin detected: " + (goFirst ? "gofirst" : "gosecond"))
{
- this.GoFirst = goFirst;
+ GoFirst = goFirst;
}
public bool GoFirst { get; protected set; }
}
-}
+}
@@ -5,9 +5,9 @@ public class DeckDetected : GameEvent
public string Key { get; protected set; }
public DeckDetected(string key)
- :base("Deck detected: " + key)
+ : base("Deck detected: " + key)
{
- this.Key = key;
+ Key = key;
}
}
-}
+}
@@ -1,14 +1,14 @@
-namespace HearthCap.Core.GameCapture.HS.Events
-{
- using System.Drawing;
+using System.Drawing;
+namespace HearthCap.Core.GameCapture.HS.Events
+{
public class DeckScreenshotTaken
{
public Bitmap Image { get; protected set; }
public DeckScreenshotTaken(Bitmap image)
{
- this.Image = image;
+ Image = image;
}
}
-}
+}
@@ -1,9 +1,8 @@
+using System;
+using HearthCap.Data;
+
namespace HearthCap.Core.GameCapture.HS.Events
{
- using System;
-
- using HearthCap.Data;
-
/// <summary>The game ended.</summary>
public class GameEnded : GameEvent
{
@@ -32,4 +31,4 @@ public GameEnded()
{
}
}
-}
+}
@@ -1,17 +1,17 @@
-namespace HearthCap.Core.GameCapture.HS.Events
-{
- using System;
+using System;
+namespace HearthCap.Core.GameCapture.HS.Events
+{
public class GameEvent
{
public GameEvent(string message)
{
- this.Date = DateTime.Now;
- this.Message = message;
+ Date = DateTime.Now;
+ Message = message;
}
-
+
public DateTime Date { get; set; }
public string Message { get; set; }
}
-}
+}
@@ -1,7 +1,7 @@
-namespace HearthCap.Core.GameCapture.HS.Events
-{
- using HearthCap.Data;
+using HearthCap.Data;
+namespace HearthCap.Core.GameCapture.HS.Events
+{
public class GameModeChanged : GameEvent
{
public GameMode OldGameMode { get; protected set; }
@@ -11,8 +11,8 @@ public class GameModeChanged : GameEvent
public GameModeChanged(GameMode oldGameMode, GameMode gameMode)
: base(string.Format("Mode changed from {0} to {1}.", oldGameMode, gameMode))
{
- this.OldGameMode = oldGameMode;
- this.GameMode = gameMode;
+ OldGameMode = oldGameMode;
+ GameMode = gameMode;
}
}
-}
+}
Oops, something went wrong.

0 comments on commit 9c38cf5

Please sign in to comment.