Start() 공개 메소드

public Start ( ) : void
리턴 void
예제 #1
0
        public void TestReactionTimeTimeContoroller()
        {
            var nowPlusSec = DateTime.Now + TimeSpan.FromSeconds(1);
            var testData   = new TestedData();

            var config = new Config()
            {
                schedulePeriod = TimeSpan.FromMilliseconds(400),
                reactionTime   = new ReactionTime()
                {
                    hour   = nowPlusSec.Hour,
                    minute = nowPlusSec.Minute,
                    second = nowPlusSec.Second
                },
                backupCondition = BackupCondition.AlwaysAtTheCertainTime
            };

            var dataPlace    = new DataPlace(testData.DirPath);
            var backupRule   = new BackupRule(dataPlace, config);
            var backuperMock = new Mock <IBackuper>();

            var timeController = new TimeController(config, backuperMock.Object);

            timeController.Start();

            Thread.Sleep(1600);

            timeController.Stop();

            backuperMock.Verify(backuper => backuper.Update(), Times.AtLeast(2));
        }
예제 #2
0
    public void replay()
    {
        if (MenuController.on_reset_event != null)
        {
            MenuController.on_reset_event(this, EventArgs.Empty);
        }

        CharacterBlock.selected_block_stack.Clear();
        CharacterBlock.last_clicked_on_character = null;
        panel.SetActive(false);
        vowel_panel.SetActive(false);
        current_word.SetActive(false);

        pc.Start();
        board_creator.Start();
        gm.Start();
        tc.Start();
        sc.Start();
    }
예제 #3
0
    void StartGame()
    {
        _gameEvents = CreateGameEvents();

        // Init game control / time vars
        _timeController.Init(_entityController, _gameEvents, _gameData.DefaultTimescale);
        _timeController.Start();

        _inputDelay = _gameData.InputDelay;
        _input.Init(_gameData.InputData, _inputDelay);

        _mapController.Init(_gameData.MapData);

        _entityController.Init(_mapController, _gameData.EntityCreationData, _gameEvents);

        _monsterCreator.Init(_entityController, _mapController, _timeController, _gameEvents.Monsters, _gameData.EntityCreationData.MonsterData);

        _eventLogger.Init(_timeController, _gameEvents);

        _hud = CreateGameHUD();

        _input.OnLayoutChanged += _hud.OnInputLayoutChanged;


        // populate the level
        PopulateLevel();

        foreach (var stateContext in _playStatesData.Values)
        {
            stateContext.Init(this);
        }
        ;

        _playStateID     = PlayStates.Action;
        _nextPlayStateID = PlayStates.Action;
        _result          = GameResult.Running;

        _hud.Init(_eventLogger, _entityController.Player, _timeController, _cameraController.UICamera);
        RegisterEntityEvents();
        _gameEvents.Flow.SendStarted();
    }
예제 #4
0
        private void showBtn_Click(object sender, EventArgs e)
        {
            control = recordingHost.Child as wpfUC.UserControl1;
            if (con != null)
            {
                try
                {
                    control.startRecClick();
                    serialPort1.Open();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error! " + ex);
                }

                TimeController.Start();
            }
            else
            {
                MessageBox.Show("Error Connecting Database!");
            }
        }
예제 #5
0
        public void TestTimeContoroller()
        {
            var testData = new TestedData();

            var config = new Config()
            {
                schedulePeriod  = TimeSpan.FromMilliseconds(500),
                backupCondition = BackupCondition.SchedulePeriodIfChanged
            };

            var dataPlace    = new DataPlace(testData.DirPath);
            var backupRule   = new BackupRule(dataPlace, config);
            var backuperMock = new Mock <IBackuper>();

            var timeController = new TimeController(config, backuperMock.Object);

            timeController.Start();

            Thread.Sleep(1250);

            timeController.Stop();

            backuperMock.Verify(backuper => backuper.Update(), Times.Exactly(2));
        }
예제 #6
0
        private static void Starter(string[] args)
        {
            ConfigLoader.Load();
            string log4netConfigPath = new PathCutHelper()
                                       .CutExecutableFileFromPath(System.Reflection.Assembly
                                                                  .GetExecutingAssembly().Location);

            log4netConfigPath += @"\Minder.log4net.xml";
            FileInfo config = new FileInfo(log4netConfigPath);

            log4net.Config.XmlConfigurator.Configure(config);
            log4net.ILog logger = log4net.LogManager.GetLogger(typeof(BootStrap));

            bool openForm = false;

            if (args != null)
            {
                foreach (string arg in args)
                {
                    if (arg.ToLower().Equals("--openform"))
                    {
                        openForm = true;
                    }
                }
            }

            SettingsLoader loader = new SettingsLoader();

            loader.LoadSettings();
            Minder.Static.StaticData.Settings.LogFilePath = @"Log\Minder.log";

            UpdateDBVersion();
            Info syncInfo = InfoFinder.FindByUniqueCode(Minder.Static.StaticData.InfoUniqueCodes.InfoLastSyncDate);

            if (syncInfo != null)
            {
                Minder.Static.StaticData.Settings.Sync.LastSyncDate = Convert.ToDateTime(syncInfo.Value1);
            }

            new StartWithWinController().StartWithWindows();
            //if(Minder.Static.StaticData.Settings.CheckUpdates)
            //	new UpdateProject(StaticData.VersionCache.Version, true, "Minder");

            MainFormPreparer preparer = new MainFormPreparer();

            if (openForm)
            {
                preparer.PrepareForm(openForm);
            }
            else
            {
                preparer.PrepareForm();
            }

            MousePositionHelper mouseMoveChecker = new MousePositionHelper();

            mouseMoveChecker.SartMouseMoveChecker();

            TimeController timeController = new TimeController(preparer);

            timeController.Start();

            logger.Info("Minder started");
        }