Example #1
0
        public void SelectAction(Customer customer)
        {
            switch (customer.MessageText)
            {
            case "/start":
                StartMenuAction.Go(customer);
                break;

            case "Контакты":
                ContactMenuAction.Go(customer);
                break;

            case "Информация":
                InformationMenuAction.Go(customer);
                break;

            case "Показать курсы НБУ":
                ExchangeRatesMenuAction.Go(customer);
                break;

            case "Рассчитать стоимость растаможки":
                CalculateTaxMenuAction.Go(customer);
                break;

            case "Рассчитать стоимость растаможки евробляхи":
                CalculateTaxEuroMenuAction.Go(customer);
                break;

            default:
                RouteAction.Go(customer);
                break;
            }
        }
Example #2
0
        public void GetStartMenuAction_ShouldReturnPlayGameIfInputIsOne(string userInput)
        {
            SetUserInput(userInput);
            int menuChoice;

            int.TryParse(userInput, out menuChoice);
            StartMenuAction expected = (StartMenuAction)menuChoice;
            StartMenuAction actual   = sut.GetStartMenuAction();

            Assert.Equal(expected, actual);
        }
Example #3
0
 public void StartGame(StartMenuAction action, string fileName)
 {
     if (action == StartMenuAction.NewGame)
     {
         NewGame();
     }
     else if (action == StartMenuAction.Continue)
     {
         LoadGame(GameData.LastSavedFileName);
     }
     else if (action == StartMenuAction.Load)
     {
         LoadGame(fileName);
     }
 }
Example #4
0
    IEnumerator StartGame(StartMenuAction action, string fileName = "")
    {
        if (fadeToPanel != null)
        {
            Instantiate(fadeToPanel, Vector3.zero, Quaternion.identity, canvas.transform);
        }
        yield return(new WaitForSeconds(fadeDuration));

        PermanentObjects.Instance.SaveManager.StartGame(action, fileName);
        //PermanentObjects.Instance.EnableVisible();
        //PermanentObjects.Instance.SaveManager.ResetAll(true);
        //var asyncOperation = SceneManager.LoadSceneAsync("Dungeon");
        //while (!asyncOperation.isDone)
        //{
        //    yield return null;
        //}
    }