public Game(Universe universe, IEnumerable<TickRegistrationFactory> tickRegistrationFactories) { Universe = universe; _updateFunctions = tickRegistrationFactories.SelectMany(f => f(universe)).ToList(); _idle = new IdleTimer(); _tick = 0; }
public void TwoSample() { var idle = new IdleTimer(); idle.Enqueue(0.25); idle.Enqueue(0.75); idle.Idle.ShouldBe(50); Console.WriteLine(idle.Idle); }
public void FiveHundredSample() { var idle = new IdleTimer(); for (var i = 0; i < 250; i++) { idle.Enqueue(0.25); idle.Enqueue(0.75); } idle.Idle.ShouldBe(50, 1); Console.WriteLine(idle.Idle); }
public void OneSample() { var idle = new IdleTimer(); idle.Enqueue(0.5); idle.Idle.ShouldBe(50); }
public void Blank() { var idle = new IdleTimer(); idle.Idle.ShouldBe(100); }