Browse Source

make some classes static and some fields readonly

master
Colin McMillen 4 years ago
parent
commit
473256d105
  1. 2
      Shared/Clock.cs
  2. 2
      Shared/FSM.cs
  3. 2
      Shared/Line.cs
  4. 2
      Shared/Timer.cs

2
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);
}

2
Shared/FSM.cs

@ -9,7 +9,7 @@ namespace SemiColinGames {
}
public class FSM<T> {
Dictionary<string, IState<T>> states;
readonly Dictionary<string, IState<T>> states;
IState<T> state;
public FSM(Dictionary<string, IState<T>> states, string initial) {

2
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);
}

2
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) {

Loading…
Cancel
Save