Ejemplo n.º 1
0
        private MainController()
        {
            _dbController = new SqlLiteController();
            //_dataController = new TestDataController();
            _dataController = new WiiController();
            _personController = new PersonController(_dbController);

            _dataController.AddSensorDataListener(new MovementRecognitionController());

            List<Person> persons = _personController.getPersons();
            try
            {
                _personController.CurrentPerson = persons[0];
            }
            catch (Exception)
            {
                string testDataScript = @"db\DbData.sql";
                string sql = File.ReadAllText(testDataScript);
                _dbController.Execute(sql);
                persons = _personController.getPersons();
                _personController.CurrentPerson = persons[0];
            }

            _notifyMessageMgr = new NotifyMessageManager
                (
                    Screen.Width,
                    Screen.Height,
                    200,
                    150
                );
            //_notifyMessageMgr.Start();
        }
 public NavigationController(DataController dataController)
 {
     _dataController = dataController;
     _wc = new Weightcontrol();
     _dataController.AddSensorDataListener(_wc);
     _cog = new CenterGravity();
     _dataController.AddSensorDataListener(_cog);
 }
Ejemplo n.º 3
0
        public GameController(DataController controller)
        {
            _lock = new object();
            _clients = new List<TcpClient>();
            IPAddress address = IPAddress.Parse("127.0.0.1");
            _serverSocket = new TcpListener(address, 9900);

            _serverSocket.Start();
            Debug.WriteLine("Server Started");

            _controller = controller;
            _controller.AddSensorDataListener(this);

            Thread thread = new Thread(new ThreadStart(WaitForClients));
            thread.IsBackground = true;
            thread.Start();
        }