Ejemplo n.º 1
0
        /// <summary>
        /// Inicializa a jogada, configurando o componente de placar do jogo
        /// </summary>
        /// <param name="placar"></param>
        public void inicializar(Placar placar)
        {
            this.nome_jogo = "";
            this.erros     = 0;
            this.acertos   = 0;
            this._sound    = true;
            StreamReader sr   = new StreamReader("config.ini");
            string       text = sr.ReadToEnd();

            try
            {
                string temp = text.Substring(text.IndexOf("[geral]") + 9);
                temp        = temp.Substring(temp.IndexOf("som") + 4, temp.IndexOf("\r\n", temp.IndexOf("som")) - (temp.IndexOf("som") + 4));
                this._sound = Convert.ToBoolean(temp);
            }
            catch { }
            sr.Close();

            this._placar             = placar != null ? placar : new Placar();
            this._jogadas_permitidas = 50;
        }
Ejemplo n.º 2
0
 public void configurarPlacar(Placar placar)
 {
     this._placar = placar != null ? placar : new Placar();
 }