public TrackingController(MainWindowViewModel mainWindowViewModel, MainWindow mainWindow) { _mainWindowViewModel = mainWindowViewModel; _mainWindow = mainWindow; EntityController = new EntityController(_mainWindow, mainWindowViewModel); DungeonController = new DungeonController(this, mainWindowViewModel); CombatController = new CombatController(this, _mainWindow, mainWindowViewModel); LootController = new LootController(this); CountUpTimer = new CountUpTimer(mainWindowViewModel); }
public void CountUpTimer_WhenProvidedWithTime_InitializesStopped() { // Arrange TimeSpan expectedSeconds = TimeSpan.FromSeconds(ExpectedTicks); // Act IPclTimer classUnderTest = new CountUpTimer(expectedSeconds); // Assert classUnderTest.CurrentTime.ShouldBe(expectedSeconds); classUnderTest.IsTimerRunning.ShouldBeFalse(); classUnderTest.IsTimerStopped.ShouldBeTrue(); }
void Start() { // Initialize attacks chargeUpTimer = new CountUpTimer(); if (isHuman) { SetupHumanFighter(); } else { SetupEnemyFighter(); } }
void Start() { GlobalManager.MemoryGameLoad(); //Ladataan aiempi aika Layers(); //käynnistää sovelluksen välittömästi ilman buttonin painamista CountUpTimer.StartGame(); //Määritellään aloittamaan laskuri alusta. CountDownTimer.Start(); Rotator.Start(); // GlobalManager.Start(); sr = GetComponent <SpriteRenderer>(); Life1 = GameObject.Find("Life1"); //Viitataan sulkeissa määriteltyyn pelinäkymän objektiin Life2 = GameObject.Find("Life2"); Life3 = GameObject.Find("Life3"); Yeti = GameObject.Find("yeti"); if (level == 1) { triesLeft = 2; Tries = 2; Life3.SetActive(false); } else if (level == 2) { triesLeft = 2; Tries = 2; Life3.SetActive(false); } else if (level == 3) { triesLeft = 2; Tries = 2; Life3.SetActive(false); } else if (level == 4) { triesLeft = 2; Tries = 2; Life3.SetActive(false); } else { triesLeft = 3; //Määritellään pelaajalle näkymättömien yritysten määrä aloitettaessa Tries = 3; //Määritellään pelaajalle näkyvien yritysten määrä aloitettaessa } countTries = GameObject.Find("Tries").GetComponent <Text>(); //Linkitetään yrityslaskuri lainausmerkeissä määriteltyyn objektiin countTries.text = Tries.ToString(); //Tulostetaan näkyvien yritysten määrä aloitettaessa linkitettyyn textiin }
public IEnumerator gameLose() { CountUpTimer.EndGame(); lmbDisabled = true; yield return(new WaitForSeconds(0.8f)); Destroy(GameObject.Find("Layer")); Destroy(GameObject.Find("Pakastinallaskansi")); Debug.Log("LayerScript: You lose"); loserText = GameObject.Find("Loser").GetComponent <Text>(); //Tulostetaan lainausmerkeissä määriteltyyn linkitettyyn textiin loserText.text = lose; yield return(new WaitForSeconds(2f)); Destroy(GameObject.Find("Loser")); }
public void CountUpTimer_WhenStarted_CountsUpAndFiresEvent() { // Arrange TimeSpan startTime = TimeSpan.Zero; int actualTicks = 0; IPclTimer classUnderTest = new CountUpTimer(startTime); classUnderTest.IntervalPassed += (o, e) => { actualTicks++; }; // Act classUnderTest.Start(); Thread.Sleep(TimeSpan.FromSeconds(ExpectedTicks * 2)); // Assert classUnderTest.CurrentTime.ShouldBeGreaterThan(startTime); actualTicks.ShouldBeGreaterThan(ExpectedTicks); }
public override void Initialize() { counter = 0; countUp = new CountUpTimer(); bulletNum = 5; Hp = 3; timer = new CountDownTimer(0.3f); IsGoal(); IsTrap(); direction = new Direction(); isJump = false; isDeadFlag = false; velocity = Vector2.Zero; position = new Vector2(32, 736); motion = new Motion(); MotionInit(); damageCnt = 0; }
/// <summary> /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる) /// </summary> protected override void Initialize() { // この下にロジックを記述 //ゲームデバイスの実体生成と取得 gameDevice = GameDevice.Instance(Content, GraphicsDevice); sceneManager = new SceneManager(); //sceneManager.Add(Scene.Scene.Title, new SceneFader(new Title())); //シーンフェーダーを追加 CountUpTimer scoreTimer = new CountUpTimer(); IScene addScene = new GamePlay(scoreTimer); sceneManager.Add(Scene.Scene.Title, new Title()); sceneManager.Add(Scene.Scene.GamePlay, addScene); sceneManager.Add(Scene.Scene.Ending, new Ending(addScene, scoreTimer)); // sceneManager.Add(Scene.Scene.Ending, new SceneFader(new Ending(addScene))); sceneManager.Change(Scene.Scene.Title); //最初のシーンはタイトルに変更 timer = new CountDownTimer(30); timerUI = new TimerUI(timer); // この上にロジックを記述 base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!! }
public IEnumerator gameWon() //show "you won" text for 4 seconds and restart the game { CountUpTimer.EndGame(); //Viitataan toiseen skriptiin kun peli päättyy. Muutetaan EndGamen sisältämä Cleared trueksi. Rotator.Stop(); GlobalManager.MemoryGameSave(); MemoryGameLevelSelecterLimitter.MemoryGamelevelilapi(level); lmbDisabled = true; // yield return new WaitForSeconds(0.1f); // Destroy(GameObject.Find("items")); yield return(new WaitForSeconds(0.8f)); Destroy(GameObject.Find("Layer")); Destroy(GameObject.Find("Pakastinallaskansi")); Debug.Log("LayerScript: You won"); youWon.SetActive(true); // Yeti.SetActive(false); yield return(new WaitForSeconds(2f)); youWon.SetActive(false); //Restart (); }
public UpdateFameEventHandler(TrackingController trackingController) : base((int)EventCodes.UpdateFame) { _trackingController = trackingController; _countUpTimer = _trackingController.CountUpTimer; }
private async Task WriteInFileAsync(CountUpTimer timer) { var diff = DateTime.Now.Subtract(timer.Timer); await File.WriteAllTextAsync(timer.Path, diff.ToString(@"hh\:mm\:ss")); }
public UpdateReSpecPointsEventHandler(TrackingController trackingController) : base((int)EventCodes.UpdateReSpecPoints) { _trackingController = trackingController; _countUpTimer = _trackingController.CountUpTimer; }
void Start() { // Initialize attacks chargeUpTimer = new CountUpTimer (); if (isHuman) { SetupHumanFighter (); } else { SetupEnemyFighter (); } }
public UpdateMoneyEventHandler(TrackingController trackingController) : base((int)EventCodes.UpdateMoney) { _countUpTimer = trackingController.CountUpTimer; }