示例#1
0
        public static void Initialize(TestContext context)
        {
            var debugLocation = Assembly.GetExecutingAssembly().Location;
            var debugFolder   = Path.GetDirectoryName(debugLocation);
            var testFolder    = Path.Combine(debugFolder, "testData");
            var files         = Directory.GetFiles(testFolder);

            InMemoryRoomRepository.initInstance(roomList);
            courseList        = SheetParser.Parse(files, InMemoryRoomRepository.getInstance());
            firstCourseRecord = courseList.First();
        }
示例#2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            // TODO: remove this. For testing only. Clear repositories
            InMemoryUserRepository.GetInstance().ConnectedUsers.ToList().Clear();
            InMemoryUserRepository.GetInstance().WaitingList.ToList().Clear();
            InMemoryRoomRepository.GetInstance().Rooms.ToList().Clear();

            var physicsTimer = new System.Timers.Timer(15);

            physicsTimer.Enabled = true;
            // Hook up the Elapsed event for the timer.
            physicsTimer.Elapsed += new ElapsedEventHandler(Engine.OnPhysicsTimedEvent);

            var updateTimer = new Timer(45);

            updateTimer.Enabled  = true;
            updateTimer.Elapsed += new ElapsedEventHandler(Engine.OnUpdateClientsTimedEvent);
        }
示例#3
0
 public HomeController()
 {
     this._userRepository = InMemoryUserRepository.GetInstance();
     this._roomRepository = InMemoryRoomRepository.GetInstance();
 }
示例#4
0
 public PongRHub()
 {
     _userRepository = InMemoryUserRepository.GetInstance();
     _roomRepository = InMemoryRoomRepository.GetInstance();
 }
示例#5
0
 public RoomProvider(IMemoryCache cache, InMemoryRoomRepository repository)
 {
     _cache      = cache;
     _repository = repository;
 }
示例#6
0
文件: PongRHub.cs 项目: vgheri/PongR
 public PongRHub()
 {
     _userRepository = InMemoryUserRepository.GetInstance();
     _roomRepository = InMemoryRoomRepository.GetInstance();
 }