public IEnumerator WHEN_CatchTheThiefStorageCreated_THEN_IdentifiedKeySetCorrectly() { ctf = new CatchTheThiefStorage(); KeyCode expectedKeyCode = KeyCode.Space; string expectedKeyName = KeyCode.Space.ToString(); yield return(null); Assert.IsTrue(ctf.IdentifiedKeyCode == expectedKeyCode); Assert.IsTrue(ctf.IdentifiedKeyName == expectedKeyName); }
/// <summary> /// FillAllGameData is to update game data objects with corresponding raw gameplay data. /// It will only get gameplay data for the games that have been played. /// </summary> public void FillAllGameData() { // Get gameplay data for Balloons // If the game has been played, get the gameplay data; else, skip this game if (!notYetPlayBalloons) { balloonsData = Balloons.GetGameplayData(); } // Get gameplay data for Squares // If the game has been played, get the gameplay data; else, skip this game if (!notYetPlaySquares) { squaresData = Squares.GetGameplayData(); } // Get gameplay data for Catch The Thief // If the game has been played, get the gameplay data; else, skip this game if (!notYetPlayCTF) { ctfData = CatchTheThief.GetGameplayData(); } // Get gameplay data for ImageHit // If the game has been played, get the gameplay data; else, skip this game if (!notYetPlayImageHit) { imageHitData = ImageHit.GetGameplayData(); } // Get gameplay data for Catch The Ball // If the game has been played, get the gameplay data; else, skip this game if (!notYetCatchTheBall) { catchTheBallData = CatchTheBall.GetGameplayData(); } // Get gameplay data for Save One Ball // If the game has been played, get the gameplay data; else, skip this game if (!notYetSaveOneBall) { saveOneBallData = SaveOneBall.GetGameplayData(); } // Get gameplay data for Judge The Ball // If the game has been played, get the gameplay data; else, skip this game if (!notYetJudgeTheBall) { judgeTheBallData = JudgeTheBall.GetGameplayData(); } }
//Helper functions start: //----------------------------------------------------------------- /// <summary> /// Initializes all state variables and objects /// necessary for the Catch The Thief mini-game. /// </summary> private void CTF_init() { // Initialize the storage variables ctfData = new CatchTheThiefStorage(); ctfData.Rounds = new List <CatchTheThiefRound>(); // Initialize game variables identifiedKeyPressTime = 0; roundNumber = 0; // The game starts with the maximum round duration roundDuration = MAX_ROUND_TIME; numberOfSquaresInGrid = displayedSquares.Count; indexThiefAppearedLastRound = 0; // Make sure that the game starts with all images disabled ClearSquares(); }