示例#1
0
文件: Game.cs 项目: andy-uq/Echo
        public Game(Universe universe, IEnumerable<TickRegistrationFactory> tickRegistrationFactories)
        {
            Universe = universe;

            _updateFunctions = tickRegistrationFactories.SelectMany(f => f(universe)).ToList();
            _idle = new IdleTimer();
            _tick = 0;
        }
示例#2
0
文件: Idle.cs 项目: andy-uq/Echo
 public void TwoSample()
 {
     var idle = new IdleTimer();
     idle.Enqueue(0.25);
     idle.Enqueue(0.75);
     idle.Idle.ShouldBe(50);
     Console.WriteLine(idle.Idle);
 }
示例#3
0
文件: Idle.cs 项目: andy-uq/Echo
        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);
        }
示例#4
0
文件: Idle.cs 项目: andy-uq/Echo
 public void OneSample()
 {
     var idle = new IdleTimer();
     idle.Enqueue(0.5);
     idle.Idle.ShouldBe(50);
 }
示例#5
0
文件: Idle.cs 项目: andy-uq/Echo
 public void Blank()
 {
     var idle = new IdleTimer();
     idle.Idle.ShouldBe(100);
 }