internal static IAssessment CreateOrderLettersInWordAssessment()
        {
            Init();
            AssessmentConfiguration.Instance.PronunceQuestionWhenClicked = true;
            AssessmentConfiguration.Instance.PronunceAnswerWhenClicked   = true;
            AssessmentConfiguration.Instance.ShowQuestionAsImage         = true;

            // V- -- NO LONGER NEED DEFAULT DRAG BEHAVIOUR
            IDragManager       dragManager       = new SortingDragManager(audioManager, context.GetCheckmarkWidget());
            IQuestionDecorator questionDecorator = new PronunceImageDecorator(); // OK

            // V- 100% -- TWEAK TO NO REMOVE LETTER
            IQuestionGenerator generator = new ImageQuestionGenerator(configuration.Questions, false);

            // V- 100% -- INJECT DIFFERENT COMPONENTS (Answers have to be "Bucketable", Question no placeholder)
            ILogicInjector  injector       = new SortingLogicInjector(dragManager, questionDecorator);
            IQuestionPlacer questionplacer = new DefaultQuestionPlacer(audioManager, wordSize, letterSize);  // OK

            // V- 100% -- Letters sorted and ticketed
            IAnswerPlacer answerPlacer = new InARowAnswerPlacer(audioManager, letterSize);

            gameDescription = Db.LocalizationDataId.Assessment_Order_Letters;

            return(new DefaultAssessment(answerPlacer, questionplacer, generator, injector,
                                         configuration, context, dialogueManager,
                                         gameDescription));
        }
Example #2
0
        public void Update(float delta)
        {
            timer -= delta;

            if (timer < 0)
            {
                game.EndGame(game.currentStars, game.maxWieght);

                if (game.currentStars == 0)
                {
                    AudioManager.I.PlayDialog("Reward_0Star");
                    //WidgetSubtitles.I.DisplaySentence(Db.LocalizationDataId.Reward_0Star, 4, true);
                }
                else
                {
                    //string dia = "Reward_" + game.currentStars + "Star_" + UnityEngine.Random.Range(1, 4);
                    Db.LocalizationDataId data = randomRewardData();
                    //WidgetSubtitles.I.gameObject.SetActive(true);
                    AudioManager.I.PlayDialog(data);
                    //WidgetSubtitles.I.DisplaySentence(data , 2, true);
                }
                //game.Context.GetAudioManager().PlayDialogue(Db.LocalizationData)
                //WidgetSubtitles.I.DisplaySentence()
                //game.EndGame(game.scale.counter / (game.targetScale / 3), game.scale.counter);
            }
        }
 public void SetSentence(Db.LocalizationDataId sentenceId)
 {
     // Debug.Log("SetSentence " + sentenceId);
     Db.LocalizationData row = LocalizationManager.GetLocalizationData(sentenceId);
     isArabic = true;
     text     = row.Arabic;
 }
Example #4
0
        public static string GetWordCategoryTitle(Db.WordDataCategory cat)
        {
            Db.LocalizationDataId loc = Db.LocalizationDataId.UI_None;
            switch (cat)
            {
            case Db.WordDataCategory.People: loc = Db.LocalizationDataId.UI_People; break;

            case Db.WordDataCategory.Conjunctions: loc = Db.LocalizationDataId.UI_Conjunctions; break;

            case Db.WordDataCategory.Feeling: loc = Db.LocalizationDataId.UI_Feelings; break;

            case Db.WordDataCategory.Food: loc = Db.LocalizationDataId.UI_Food; break;

            case Db.WordDataCategory.FamilyMember: loc = Db.LocalizationDataId.UI_FamilyMembers; break;

            case Db.WordDataCategory.BodyPart: loc = Db.LocalizationDataId.UI_BodyParts; break;

            case Db.WordDataCategory.Thing: loc = Db.LocalizationDataId.UI_Things; break;

            case Db.WordDataCategory.Place: loc = Db.LocalizationDataId.UI_Places; break;

            case Db.WordDataCategory.Sport: loc = Db.LocalizationDataId.UI_Sports; break;

            case Db.WordDataCategory.Animal: loc = Db.LocalizationDataId.UI_Animals; break;

            case Db.WordDataCategory.General: loc = Db.LocalizationDataId.UI_General; break;

            case Db.WordDataCategory.Furniture: loc = Db.LocalizationDataId.UI_Furniture; break;

            case Db.WordDataCategory.Size: loc = Db.LocalizationDataId.UI_Size; break;

            case Db.WordDataCategory.Nature: loc = Db.LocalizationDataId.UI_Nature; break;

            case Db.WordDataCategory.Vehicle: loc = Db.LocalizationDataId.UI_Vehicles; break;

            case Db.WordDataCategory.Job: loc = Db.LocalizationDataId.UI_Jobs; break;

            case Db.WordDataCategory.Clothes: loc = Db.LocalizationDataId.UI_Clothes; break;

            case Db.WordDataCategory.Color: loc = Db.LocalizationDataId.UI_Colors; break;

            case Db.WordDataCategory.Time: loc = Db.LocalizationDataId.UI_Time; break;

            case Db.WordDataCategory.Direction: loc = Db.LocalizationDataId.UI_Directions; break;

            case Db.WordDataCategory.Position: loc = Db.LocalizationDataId.UI_Positions; break;

            case Db.WordDataCategory.Number: loc = Db.LocalizationDataId.UI_Numbers; break;

            case Db.WordDataCategory.NumberOrdinal: loc = Db.LocalizationDataId.UI_NumbersOrdinal; break;

            case Db.WordDataCategory.Shape: loc = Db.LocalizationDataId.UI_Shapes; break;
            }
            return(GetTranslation(loc));
        }
Example #5
0
 public void Show(System.Action callback, Db.LocalizationDataId text, LL_WordData word = null)
 {
     if (word != null)
     {
         WidgetPopupWindow.I.ShowSentenceAndWord(callback, text, word);
     }
     else
     {
         WidgetPopupWindow.I.ShowSentence(callback, text);
     }
 }
Example #6
0
 public void PlayDialogue(Db.LocalizationDataId text, System.Action callback = null)
 {
     if (callback == null)
     {
         AudioManager.I.PlayDialog(text.ToString());
     }
     else
     {
         AudioManager.I.PlayDialog(text.ToString(), callback);
     }
 }
Example #7
0
 public void Show(System.Action callback, Db.LocalizationDataId text, bool markResult, LL_WordData word = null)
 {
     if (word != null)
     {
         WidgetPopupWindow.I.ShowSentenceAndWordWithMark(callback, text, word, markResult);
     }
     else
     {
         WidgetPopupWindow.I.ShowSentenceWithMark(callback, text, markResult, null);
     }
 }
Example #8
0
        public void ShowSentenceAndWord(Action callback, Db.LocalizationDataId SentenceId, LL_WordData wordData)
        {
            ResetContents();

            currentCallback = callback;
            ButtonGO.gameObject.SetActive(callback != null);

            TitleGO.GetComponent <TextRender>().SetSentence(SentenceId);

            //AudioManager.I.PlayDialog(SentenceId);

            SetWord(wordData.DrawingCharForLivingLetter, wordData);

            Show(true);
        }
Example #9
0
        public void ShowSentence(Action callback, Db.LocalizationDataId SentenceId)
        {
            ResetContents();

            currentCallback = callback;
            ButtonGO.gameObject.SetActive(callback != null);

            Db.LocalizationData row = LocalizationManager.GetLocalizationData(SentenceId);

            TitleGO.GetComponent <TextRender>().isArabic = true;
            TitleGO.GetComponent <TextRender>().text     = row.Arabic;

            AudioManager.I.PlayDialog(SentenceId);

            Show(true);
        }
 public DefaultAssessment(IAnswerPlacer answ_placer,
                          IQuestionPlacer question_placer,
                          IQuestionGenerator question_generator,
                          ILogicInjector logic_injector,
                          IAssessmentConfiguration game_conf,
                          IGameContext game_context,
                          IDialogueManager dialogues,
                          Db.LocalizationDataId gameDescription)
 {
     AnswerPlacer      = answ_placer;
     QuestionGenerator = question_generator;
     QuestionPlacer    = question_placer;
     LogicInjector     = logic_injector;
     Configuration     = game_conf;
     GameContext       = game_context;
     Dialogues         = dialogues;
     GameDescription   = gameDescription;
 }
        public static IAssessment CreateMatchLettersWordAssessment()
        {
            Init();
            AssessmentConfiguration.Instance.PronunceQuestionWhenClicked = true;
            AssessmentConfiguration.Instance.PronunceAnswerWhenClicked   = true;
            IAnswerChecker     checker           = new DefaultAnswerChecker(context.GetCheckmarkWidget(), audioManager, dialogueManager);
            IDragManager       dragManager       = new DefaultDragManager(audioManager, checker);
            IQuestionDecorator questionDecorator = new PronunceQuestionDecorator();
            IQuestionGenerator generator         = new DefaultQuestionGenerator(configuration.Questions);
            ILogicInjector     injector          = new DefaultLogicInjector(dragManager, questionDecorator);
            IQuestionPlacer    questionplacer    = new DefaultQuestionPlacer(audioManager, wordSize, letterSize);
            IAnswerPlacer      answerPlacer      = new DefaultAnswerPlacer(audioManager);

            gameDescription = Db.LocalizationDataId.Assessment_Match_Letters_Words;

            return(new DefaultAssessment(answerPlacer, questionplacer, generator, injector,
                                         configuration, context, dialogueManager,
                                         gameDescription));
        }
Example #12
0
        public void ShowSentence(Action callback, Db.LocalizationDataId sentenceId, Sprite image2show)
        {
            ResetContents();

            currentCallback = callback;
            ButtonGO.gameObject.SetActive(callback != null);

            if (image2show != null)
            {
                TutorialImageGO.GetComponent <Image>().sprite = image2show;
                TutorialImageGO.SetActive(true);
            }

            Db.LocalizationData row = LocalizationManager.GetLocalizationData(sentenceId);
            TitleGO.GetComponent <TextRender>().isArabic = true;
            TitleGO.GetComponent <TextRender>().text     = row.Arabic;

            AudioManager.I.PlayDialog(sentenceId);

            Show(true);
        }
        public static IAssessment CreateSunMoonLetterAssessment()
        {
            Init();
            AssessmentConfiguration.Instance.PronunceQuestionWhenClicked = true;
            AssessmentConfiguration.Instance.PronunceAnswerWhenClicked   = true;
            IAnswerChecker     checker           = new DefaultAnswerChecker(context.GetCheckmarkWidget(), audioManager, dialogueManager);
            IDragManager       dragManager       = new DefaultDragManager(audioManager, checker);
            IQuestionDecorator questionDecorator = new PronunceQuestionDecorator();
            ICategoryProvider  categoryProvider  = new CategoryProvider(CategoryType.SunMoon);
            IQuestionGenerator generator         = new CategoryQuestionGenerator(configuration.Questions,
                                                                                 categoryProvider,
                                                                                 maxAnswers, rounds);
            ILogicInjector  injector       = new DefaultLogicInjector(dragManager, questionDecorator);
            IQuestionPlacer questionplacer = new CategoryQuestionPlacer(audioManager, letterSize, letterSize);
            IAnswerPlacer   answerPlacer   = new DefaultAnswerPlacer(audioManager);

            gameDescription = Db.LocalizationDataId.Assessment_Classify_Letters_Article;

            return(new DefaultAssessment(answerPlacer, questionplacer, generator, injector,
                                         configuration, context, dialogueManager,
                                         gameDescription));
        }
Example #14
0
        public void ShowSentenceWithMark(Action callback, Db.LocalizationDataId sentenceId, bool result, Sprite image2show)
        {
            ResetContents();

            currentCallback = callback;
            ButtonGO.gameObject.SetActive(callback != null);

            MarkOK.SetActive(result);
            MarkKO.SetActive(!result);

            if (image2show != null)
            {
                TutorialImageGO.GetComponent <Image>().sprite = image2show;
                TutorialImageGO.SetActive(true);
            }

            TitleGO.GetComponent <TextRender>().SetSentence(sentenceId);

            AudioManager.I.PlayDialog(sentenceId);

            Show(true);
        }
Example #15
0
 public static Db.LocalizationData GetLocalizationData(Db.LocalizationDataId id)
 {
     return(AppManager.I.DB.GetLocalizationDataById(id.ToString()));
 }
Example #16
0
 public void PlayDialog(Db.LocalizationDataId id, System.Action callback)
 {
     PlayDialog(LocalizationManager.GetLocalizationData(id), callback);
 }
Example #17
0
 public void PlayDialog(Db.LocalizationDataId id)
 {
     PlayDialog(LocalizationManager.GetLocalizationData(id));
 }
 public void PlayDialog(Db.LocalizationDataId id, bool isKeeper = true, bool autoClose = true, System.Action _callback = null)
 {
     PlayDialog(LocalizationManager.GetLocalizationData(id), isKeeper, autoClose, _callback);
 }
Example #19
0
 public void SetTitleSentence(Db.LocalizationDataId SentenceId)
 {
     TitleGO.GetComponent <TextRender>().SetSentence(SentenceId);
 }
Example #20
0
 public void SetMessage(Db.LocalizationDataId SentenceId)
 {
     MessageTextGO.GetComponent <TextRender>().SetSentence(SentenceId);
 }
        /// <summary>
        /// Activate view elements if SentenceId != "" and display sentence.
        /// </summary>
        public void DisplaySentence(Db.LocalizationDataId _sentenceId, float _duration = 2, bool _isKeeper = false, System.Action _callback = null)
        {
            var data = LocalizationManager.GetLocalizationData(_sentenceId);

            DisplaySentence(data, _duration, _isKeeper, _callback);
        }
Example #22
0
 public void SetTitle(Db.LocalizationDataId text)
 {
     WidgetPopupWindow.I.SetTitleSentence(text);
 }
Example #23
0
 public void SetMessage(Db.LocalizationDataId text)
 {
     WidgetPopupWindow.I.SetMessage(text);
 }
Example #24
0
 public static string GetTranslation(Db.LocalizationDataId id)
 {
     return(GetLocalizationData(id).Arabic);
 }
Example #25
0
 public void DisplaySentence(Db.LocalizationDataId text, float enterDuration, bool showSpeaker, System.Action onSentenceCompleted)
 {
     WidgetSubtitles.I.DisplaySentence(text, enterDuration, showSpeaker, onSentenceCompleted);
 }
Example #26
0
 public void PlayText(Db.LocalizationDataId text)
 {
     PlayDialogue(text, null);
 }