private void Awake()
 {
     charCReference  = gameObject.GetComponent <Character>();
     platformScript  = GameObject.FindGameObjectWithTag("Platforms").GetComponent <PlatformScript>();
     gameQReference  = gameObject.GetComponent <GameQuestions>();
     buttonsGame     = gameObject.GetComponent <ButtonsGame>();
     animReference   = gameObject.GetComponent <AnimationScript>();
     uIGameReference = gameObject.GetComponent <UIGame>();
     camMReference   = gameObject.GetComponent <CameraManager>();
 }
 private void Start()
 {
     randomAnswerWord = new string[3] {
         aAnswer.text, bAnswer.text, cAnswer.text
     };
     gQReferences = gameObject.GetComponent <GameQuestions>();
     gSReferences = gameObject.GetComponent <GameSentences>();
     gQReferences.SendGeneralCAnswersValues(generalCultureCorrectAnswer, generalCultureWrongAnswer, generalCultureWrongAnswer2);
     gSReferences.SendStringArray(sentencesArray);
 }
        public void GivenPlayerIsDidntHavePenalty_And_MakeRollAction_Should_AddRoll_ToPlayers_Place()
        {
            var gamePlayers = new GamePlayers();
            var player      = new Player("A");

            gamePlayers.AddPlayer(player);
            GameQuestions gameQuestions = new GameQuestions();
            RollBehaviour rollBehaviour = new RollBehaviour(gamePlayers, gameQuestions);

            Assert.AreEqual(0, player.Place);

            rollBehaviour.MakeRollAction(new Roll(2));

            Assert.AreEqual(2, player.Place);
        }
        public void GivenPlayerIsInPenaltyy_And_MakeRollAction_Should_Not_AddRoll_ToPlayers_Place_WhenPlayerMadeEvenRoll()
        {
            var gamePlayers = new GamePlayers();
            var player      = new Player("A");

            gamePlayers.AddPlayer(player);
            GameQuestions gameQuestions = new GameQuestions();
            RollBehaviour rollBehaviour = new RollBehaviour(gamePlayers, gameQuestions);

            player.SetPenalty();

            Assert.AreEqual(0, player.Place);

            rollBehaviour.MakeRollAction(new Roll(2));

            Assert.AreEqual(0, player.Place);
        }
        public void GivenPlayerIsInPenalty_And_MakeRollAction_ShouldGiveLibertyWhenOddRollIsMade()
        {
            var gamePlayers = new GamePlayers();
            var player      = new Player("A");

            gamePlayers.AddPlayer(player);
            GameQuestions gameQuestions = new GameQuestions();
            RollBehaviour rollBehaviour = new RollBehaviour(gamePlayers, gameQuestions);

            player.SetPenalty();

            Assert.AreEqual(false, player.Liberty);

            rollBehaviour.MakeRollAction(new Roll(3));

            Assert.AreEqual(true, player.Liberty);
        }
Beispiel #6
0
        public void CreateAtLeast50SimplifiedQuestionsForEachCategory(Category category)
        {
            const int expectedNumberOfQuestions = 50;
            var       gameQuestions             = new GameQuestions();

            for (var i = 0; i < expectedNumberOfQuestions; i++)
            {
                var stringWriter = new StringWriter();
                Console.SetOut(stringWriter);
                Console.SetError(stringWriter);
                var expectedQuestion = category + " Question " + i + "\n";

                gameQuestions.AskQuestion(category);
                var question = stringWriter.ToString();

                Assert.That(question, Is.EqualTo(expectedQuestion));
            }
        }
Beispiel #7
0
        public void AskQuestionForGivenCategory(Category category)
        {
            var stringWriter = new StringWriter();

            Console.SetOut(stringWriter);
            Console.SetError(stringWriter);
            var questions = new LinkedList <string>();

            questions.AddLast("expectedQuestion");

            var gameQuestions = new GameQuestions(new Dictionary <Category, LinkedList <string> >
            {
                { category, questions },
            });

            gameQuestions.AskQuestion(category);
            var actualQuestion = stringWriter.ToString();

            Assert.That(actualQuestion, Is.EqualTo("expectedQuestion\n"));
        }
 public void Init()
 {
     _gameQuestions = new GameQuestions();
 }
Beispiel #9
0
 public Game()
 {
     _gamePlayers   = new GamePlayers();
     _gameQuestions = new GameQuestions();
 }
Beispiel #10
0
 public RollBehaviour(GamePlayers gamePlayers, GameQuestions gameQuestions)
 {
     _gamePlayers   = gamePlayers;
     _gameQuestions = gameQuestions;
 }