From 473256d1058378175ad9ae6220429cc545203c30 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Mon, 9 Mar 2020 12:48:10 -0400 Subject: [PATCH] make some classes static and some fields readonly --- Shared/Clock.cs | 2 +- Shared/FSM.cs | 2 +- Shared/Line.cs | 2 +- Shared/Timer.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Shared/Clock.cs b/Shared/Clock.cs index 0ddccda..4a802f7 100644 --- a/Shared/Clock.cs +++ b/Shared/Clock.cs @@ -1,7 +1,7 @@ using System; namespace SemiColinGames { - public class Clock { + public static class Clock { public static void AddModelTime(double seconds) { ModelTime += TimeSpan.FromSeconds(seconds); } diff --git a/Shared/FSM.cs b/Shared/FSM.cs index dfe8cc2..23f8704 100644 --- a/Shared/FSM.cs +++ b/Shared/FSM.cs @@ -9,7 +9,7 @@ namespace SemiColinGames { } public class FSM { - Dictionary> states; + readonly Dictionary> states; IState state; public FSM(Dictionary> states, string initial) { diff --git a/Shared/Line.cs b/Shared/Line.cs index 5d243a3..03446cd 100644 --- a/Shared/Line.cs +++ b/Shared/Line.cs @@ -2,7 +2,7 @@ using System; namespace SemiColinGames { - public class Line { + public static class Line { public static Point[] Rasterize(Point p1, Point p2) { return Line.Rasterize(p1.X, p1.Y, p2.X, p2.Y); } diff --git a/Shared/Timer.cs b/Shared/Timer.cs index cb160c7..4c432c0 100644 --- a/Shared/Timer.cs +++ b/Shared/Timer.cs @@ -7,8 +7,8 @@ namespace SemiColinGames { private readonly Stopwatch stopwatch = new Stopwatch(); private readonly double targetTime; private readonly string name; + private readonly int[] histogram = new int[21]; private double startTime = 0.0; - private int[] histogram = new int[21]; private int totalFrames = 0; public Timer(double targetTime, string name) {