Created
February 14, 2010 00:07
-
-
Save tunatoksoz/303761 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SimulationTimeSource : ITimeSource | |
{ | |
private readonly LiveLab game; | |
private TimeSpan timeSpan; | |
public SimulationTimeSource(LiveLab game) | |
{ | |
this.game = game; | |
this.timeSpan = new TimeSpan(); | |
this.game.GameUpdated += (timeSpan) => | |
this.timeSpan = timeSpan.Add(timeSpan); | |
} | |
#region ITimeSource Members | |
public TimeSpan Time | |
{ | |
get { return timeSpan; } | |
} | |
public bool Started | |
{ | |
get { return true; } | |
} | |
#endregion | |
} | |
public class SimulationTimeSource : ITimeSource | |
{ | |
private readonly LiveLab game; | |
private TimeSpan timeSpan; | |
public SimulationTimeSource(LiveLab game) | |
{ | |
this.game = game; | |
timeSpan = new TimeSpan(); | |
this.game.GameUpdated += (timeSpan) => | |
this.timeSpan = timeSpan.Add(timeSpan); | |
} | |
#region ITimeSource Members | |
public TimeSpan Time | |
{ | |
get { return timeSpan; } | |
} | |
public bool Started | |
{ | |
get { return true; } | |
} | |
#endregion | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment