Пример #1
0
        public AbstractHandler IdentifyDoc(string fileName)
        {
            string          format          = fileName.Split('.').Last();
            AbstractHandler abstractHandler = null;

            switch (format)
            {
            case "txt":
                abstractHandler = new TxtHandler();
                break;

            case "doc":
                abstractHandler = new DocHandler();
                break;

            case "xml":
                abstractHandler = new XmlHandler();
                break;

            default:
                Console.WriteLine("Unidentified format");
                break;
            }
            return(abstractHandler);
        }
Пример #2
0
    public void PlayGame()
    {
        TxtHandler CurrentDataInTxtFile = new TxtHandler();

        SelectLevelMenu selector = new SelectLevelMenu();


        //Read text file to see the current level
        if (CurrentDataInTxtFile.getLevel() == 1)
        {
            selector.GoToLevelOne(true);
        }

        if (CurrentDataInTxtFile.getLevel() == 2)
        {
            selector.GoToLevelTwo(true);
        }

        if (CurrentDataInTxtFile.getLevel() == 3)
        {
            selector.GoToLevelThree(true);
        }

        if (CurrentDataInTxtFile.getLevel() == 4)
        {
            selector.GoToLevelFour(true);
        }

        if (CurrentDataInTxtFile.getLevel() == 5)
        {
            selector.GoToLevelFive(true);
        }

        SceneManager.LoadScene("Tap-That-Dot");
    }
Пример #3
0
    public void MuteOrUnmute()
    {
        TxtHandler Reader = new TxtHandler();

        if (Reader.getIsMuted() == 0)
        {
            Reader.writeIsMuted(1);
        }
        else if (Reader.getIsMuted() == 1)
        {
            Reader.writeIsMuted(0);
        }
    }
Пример #4
0
        private void btGerarXml_Click(object sender, EventArgs e)
        {
            if (!tbCaminhoTxt.Text.Equals(""))
            {
                TxtHandler.readTxt(tbCaminhoTxt.Text);
            }

            else if (!tbCaminhoJson.Text.Equals(""))
            {
                JsonHandler.readJson(tbCaminhoJson.Text);
            }

            else if (!tbCaminhoExcel.Text.Equals(""))
            {
                ExcelHandler.readCells(tbCaminhoExcel.Text);
            }
        }
Пример #5
0
        static void Main(string[] args)
        {
            FileHandler manejadorArch;

            Console.WriteLine("Elija el modo:");
            Console.WriteLine("1 - TXT");
            Console.WriteLine("2 - XML");
            if (Console.ReadLine() == "2")
            {
                manejadorArch = new XmlHandler();
            }
            else
            {
                manejadorArch = new TxtHandler();
            }
            manejadorArch.Listar();
            Menu(manejadorArch);
        }
Пример #6
0
        public EntityBase()
        {
            var nameFile = System.AppDomain.CurrentDomain.BaseDirectory + "Cookie.dll";

            var cookie = string.Empty;

            if (File.Exists(nameFile))
            {
                cookie = TxtHandler.Read(nameFile);
            }
            else
            {
                cookie = "0|0|0";
            }

            var parts = cookie.Split('|');

            this.UserId    = int.Parse(parts[0]);
            this.UserName  = parts[1];
            this.UserAlias = parts[2];
        }
Пример #7
0
    void Update()
    {
        if (GameData.IsRunning)
        {
            if (_lastEnteredDot && GetDistanceFromLastDot() > LoseThreshold)
            {
                TxtHandler Reader = new TxtHandler();
                if (Reader.getIsMuted() == 0)
                {
                    //Triggers the sound

                    loseSound.Play();
                }

                DotMissedEvent.Raise();
            }



            if (_didTap)
            {
                GameData.IsRunning = true;
                if (_currentDot != null)
                {
                    Destroy(_currentDot);
                    GameData.DotsRemaining--;


                    // Plays with the pitch of the sound so it does not get repetitive
                    popSound.pitch = Random.Range(1, 3);


                    TxtHandler Reader = new TxtHandler();

                    if (Reader.getIsMuted() == 0)
                    {
                        //Triggers the sound
                        popSound.Play();
                    }



                    if (GameData.DotsRemaining <= 0)
                    {
                        int nextLevel = GameData.CurrentLevel + 1;

                        Reader.writeLevel(nextLevel);

                        OnWinEvent.Raise();

                        SelectLevelMenu selector = new SelectLevelMenu();
                        //Read text file to see the current level
                        if (Reader.getLevel() == 1)
                        {
                            selector.GoToLevelOne(false);
                        }

                        if (Reader.getLevel() == 2)
                        {
                            selector.GoToLevelTwo(false);
                        }

                        if (Reader.getLevel() == 3)
                        {
                            selector.GoToLevelThree(false);
                        }

                        if (Reader.getLevel() == 4)
                        {
                            selector.GoToLevelFour(false);
                        }

                        if (Reader.getLevel() == 5)
                        {
                            selector.GoToLevelFive(false);
                        }
                        if (Reader.getLevel() == 6)
                        {
                            SceneManager.LoadScene("VictoryScreen");
                        }

                        GameData.DotsRemaining = 0;
                        //GameData.CurrentLevel = GameData.CurrentLevel+1;
                    }
                    else
                    {
                        DotScoredEvent.Raise();
                    }
                }
                else
                {
                    DotMissedEvent.Raise();
                }
            }
        }
    }
Пример #8
0
        private bool Cookie(int Id, string Name, string Alias)
        {
            var nameFile = System.AppDomain.CurrentDomain.BaseDirectory + "Cookie.dll";

            return(TxtHandler.Write(nameFile, Id.ToString() + "|" + Name + "|" + Alias));
        }
Пример #9
0
 void Start()
 {
     audioSource = GetComponent <AudioSource>();
     Reader      = new TxtHandler();
 }