From 84fa04467510aa99cea72071fc60ee5a1997fff2 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Fri, 24 Jan 2020 21:09:09 -0500 Subject: [PATCH] more readability fixed via Visual Studio suggestions GitOrigin-RevId: 330f13485cee32f3a069442bad69c57911a0a34c --- Shared/Line.cs | 2 +- Shared/Player.cs | 7 ++++--- Shared/SneakGame.cs | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Shared/Line.cs b/Shared/Line.cs index 0a4c44c..881897a 100644 --- a/Shared/Line.cs +++ b/Shared/Line.cs @@ -20,7 +20,7 @@ namespace SemiColinGames { int dy = -Math.Abs(y2 - y1); int stepY = y1 < y2 ? 1 : -1; int error = dx + dy; - int errorXY = 0; // Error value e_xy from the PDF. + int errorXY; // Error value e_xy from the PDF. // The size of the output is the size of the longer dimension, plus one. int resultSize = Math.Max(dx, -dy) + 1; var result = new Point[resultSize]; diff --git a/Shared/Player.cs b/Shared/Player.cs index b67500a..95baa00 100644 --- a/Shared/Player.cs +++ b/Shared/Player.cs @@ -104,11 +104,12 @@ namespace SemiColinGames { pose = Pose.Standing; } } - + // Returns the desired (dx, dy) for the player to move this frame. Vector2 HandleInput(float modelTime, History input) { - Vector2 result = new Vector2(); - result.X = (int) (input[0].Motion.X * moveSpeed * modelTime); + Vector2 result = new Vector2() { + X = (int) (input[0].Motion.X * moveSpeed * modelTime) + }; if (input[0].Jump && !input[1].Jump && jumps > 0) { jumpTime = 0.3; diff --git a/Shared/SneakGame.cs b/Shared/SneakGame.cs index c9775c2..02c5b2d 100644 --- a/Shared/SneakGame.cs +++ b/Shared/SneakGame.cs @@ -27,8 +27,9 @@ namespace SemiColinGames { readonly Camera camera = new Camera(); public SneakGame() { - graphics = new GraphicsDeviceManager(this); - graphics.SynchronizeWithVerticalRetrace = false; + graphics = new GraphicsDeviceManager(this) { + SynchronizeWithVerticalRetrace = false + }; IsFixedTimeStep = true; TargetElapsedTime = TimeSpan.FromSeconds(1.0 / 60); IsMouseVisible = true; @@ -107,7 +108,7 @@ namespace SemiColinGames { string fpsText = $"{GraphicsDevice.Viewport.Width}x{GraphicsDevice.Viewport.Height}, " + $"{fpsCounter.Fps} FPS"; if (paused) { - fpsText = fpsText + " (paused)"; + fpsText += " (paused)"; } Debug.SetFpsText(fpsText);