Compare commits

...

2 Commits

7 changed files with 12 additions and 5 deletions

View File

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

View File

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

View File

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

View File

@ -121,7 +121,7 @@ namespace SemiColinGames {
}
if (paused) {
string text = "Paused";
string text = Strings.Paused;
Vector2 position = Textures.BannerFont.CenteredOn(text, camera.HalfSize);
Text.DrawOutlined(spriteBatch, Textures.BannerFont, text, position, Color.White);
music.Pause();

View File

@ -15,6 +15,7 @@
<Compile Include="$(MSBuildThisFileDirectory)NPC.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SoundEffects.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Sprites.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Strings.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Text.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Textures.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Clock.cs" />

6
Shared/Strings.cs Normal file
View File

@ -0,0 +1,6 @@
// This file contains all user-visible strings which might one day wish to be translated.
namespace SemiColinGames {
public static class Strings {
public const string Paused = "Paused";
}
}

View File

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