Skip to content

Instantly share code, notes, and snippets.

@tunatoksoz
Created February 14, 2010 00:07
Show Gist options
  • Save tunatoksoz/303761 to your computer and use it in GitHub Desktop.
Save tunatoksoz/303761 to your computer and use it in GitHub Desktop.
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