Beispiel #1
0
    public void GerarCaixaEmail()
    {
        leituraArquivo = GameObject.Find("LeituraArquivo").GetComponent <LeituraArquivo>() as LeituraArquivo;
        leituraArquivo.CarregarArquivo();
        isValido = false;

        for (int i = 1; i <= qtdEmailSorteado; i++)
        {
            while (!isValido)
            {
                codigoEmail = Random.Range(1, leituraArquivo.getQuantidadeEmails() + 1);
                isValido    = gerenciador.addCodigo(codigoEmail);
            }

            if (GameObject.Find("Painel"))
            {
                dataEnvio = "Dia " + Data.ObterData();
            }
            else
            {
                dataEnvio = "";
            }

            posicao = new Vector3(posicaoX, posicaoY, 1f);

            GameObject gameObjectFilha = Instantiate(email, posicao, email.transform.rotation) as GameObject;
            gameObjectFilha.transform.SetParent(GameObject.Find("GerenciadorEmail").transform);
            gameObjectFilha.transform.localScale = new Vector3(1f, 1f);
            gameObjectFilha.transform.SetAsFirstSibling();

            posicaoY -= 0.1f;

            isValido = false;
        }

        remetenteEmail = GameObject.FindGameObjectsWithTag("Remetente");

        foreach (GameObject remetente in remetenteEmail)
        {
            Email scriptEmail = remetente.transform.parent.GetComponent <Email>() as Email;
            remetente.GetComponent <Text>().text = leituraArquivo.Remetente(scriptEmail.codigoEmail);
        }

        tituloEmail = GameObject.FindGameObjectsWithTag("Titulo");

        foreach (GameObject titulo in tituloEmail)
        {
            Email scriptEmail = titulo.transform.parent.GetComponent <Email>() as Email;
            titulo.GetComponent <Text>().text = leituraArquivo.Titulo(scriptEmail.codigoEmail);
        }

        dataEmail = GameObject.FindGameObjectsWithTag("Data");

        foreach (GameObject data in dataEmail)
        {
            data.GetComponent <Text>().text = data.transform.parent.gameObject.GetComponent <Email>().dataEnvio;
        }

        AlterarCaixaEmail(true);
    }
Beispiel #2
0
    // Metodo para realizar acao da escolha do usuario de acordo com e-mail selecionado.
    public void opcao(string resposta)
    {
        leituraArquivo = GameObject.Find("LeituraArquivo").GetComponent <LeituraArquivo>() as LeituraArquivo;

        // Se o e-mail nao foi respondido.
        if (!isRespondido)
        {
            // Busco e-mail, em seguida envio como parametro sua resposta e altero o estado para respondido.
            this.getEmail(resposta);

            if (resposta.Equals("aceitar"))
            {
                int idProjeto = 0;

                //Debug.Log ("IdProjeto: " + leituraArquivo.IdProjetoEmail (idEmail));
                int.TryParse(leituraArquivo.IdProjetoEmail(idEmail), out idProjeto);

                if (idProjeto != 0)
                {
                    Projeto.aumentaQtdProjetos();
                    //Debug.Log ("Quantidade projetos: " + Projeto.getQtdProjetos ());
                    //Debug.Log ("Projeto " + Projeto.getQtdProjetos ().ToString ());
                    Projeto p = GameObject.Find("TelaEstacaoTrabalho").transform.FindChild("TelaInicial/Projeto " + Projeto.getQtdProjetos().ToString()).GetComponent <Projeto> () as Projeto;
                    p.criarProjeto(idProjeto);
                }
                else
                {
                    //Debug.Log ("E-mail nao possui um projeto");
                }

                this.transform.FindChild("UI/Canvas/Respostas").gameObject.SetActive(false);
                this.transform.FindChild("UI/Canvas/Aceito").gameObject.SetActive(true);

                // leitura do arquivo de Email.xml
                leituraArquivo.CarregarArquivo();

                //Debug.Log ("clicou para aceitar o email " + idEmail);
            }
            else if (resposta.Equals("recusar"))
            {
                this.transform.FindChild("UI/Canvas/Respostas").gameObject.SetActive(false);
                this.transform.FindChild("UI/Canvas/Recusado").gameObject.SetActive(true);
                Navegador.AdicionarListaNoticias(idEmail);
                Desempenho.AddProjeto(idEmail, 0, false);
            }
            else
            {
                //Debug.Log ("Opçao invalida.");
            }

            // Marco a resposta da tela atual para respondido e invalidando acesso aos botoes da tela.
            this.isRespondido = true;
        }
        else
        {
            //Debug.Log("Este e-mail ja foi respondido e portanto os botoes ficaram sem acao.");
        }
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        if (botaoCaixaEntrada)
        {
            telaResposta = GameObject.Find("RespostaEmail(Clone)");
        }

        leituraArquivo = GameObject.Find("LeituraArquivo").GetComponent <LeituraArquivo>() as LeituraArquivo;
        gerenciador    = GameObject.Find("TelaEmail").GetComponent <GerenciadorEmail>() as GerenciadorEmail;
        //estacaoTrabalho = GameObject.Find("TelaEstacaoTrabalho").GetComponent<EstacaoDeTrabalho>() as EstacaoDeTrabalho;
    }
Beispiel #4
0
    // Use this for initialization
    void Start()
    {
        leituraArquivo = GameObject.Find("LeituraArquivo").GetComponent <LeituraArquivo>() as LeituraArquivo;

        //Verfifica se existe um painel criado no jogo se nao destroi este gameObject.
        if (!GerenciadorCriado)
        {
            //Salvo os dados do painel.
            DontDestroyOnLoad(this);
            GerenciadorCriado = true;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }
Beispiel #5
0
    public void criarProjeto(int id)
    {
        leituraArquivo = GameObject.Find("LeituraArquivo").GetComponent <LeituraArquivo>() as LeituraArquivo;

        leituraArquivo.LerArquivoProjeto();

        int.TryParse(leituraArquivo.TempoProjeto(id), out turnosTotal);
        nomeProjeto = leituraArquivo.NomeProjeto(id);

        valor     = int.Parse(leituraArquivo.ValorMaxProjeto(id));
        idProjeto = id;

        progresso = 0;

        iconeAtivado    = (Texture2D)Resources.Load("IconesProjetos/" + /*id.ToString ()*/ "1" + "-1", typeof(Texture2D)) as Texture2D;
        iconeDesativado = (Texture2D)Resources.Load("IconesProjetos/" + /*id.ToString ()*/ "1" + "-0", typeof(Texture2D)) as Texture2D;
    }
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Tem certeza que deseja prosseguir com a importação? Este processo só pode ser realizado uma vez.", "Atenção", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2);

            if (dr == DialogResult.No)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            LeituraArquivo.LerAquivo("ArquivoEntrada.txt", ' ');

            //OpenFileDialog ofd = new OpenFileDialog();
            //if (ofd.ShowDialog() == DialogResult.OK)
            //    LeituraArquivo.LerAquivo(ofd.FileName, ' ');

            MessageBox.Show("Importação finalizada!", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);

            Cursor.Current = Cursors.Default;
        }
Beispiel #7
0
 public GrafoNaoDirigidoBuilder PrimEsperado()
 {
     this.grafo = LeituraArquivo.GrafoNaoDirigido(@"..\..\txts\NaoDirigido\PrimEsperado.txt");
     return(this);
 }
Beispiel #8
0
 public GrafoNaoDirigidoBuilder GrafoComplementar()
 {
     this.grafo = LeituraArquivo.GrafoNaoDirigido(@"..\..\txts\NaoDirigido\Complementar.txt");
     return(this);
 }
Beispiel #9
0
 public GrafoNaoDirigidoBuilder GrafoUnicursal()
 {
     this.grafo = LeituraArquivo.GrafoNaoDirigido(@"..\..\txts\NaoDirigido\Conexo,NaoCompleto,NaoEuleriano,Unicursal.txt");
     return(this);
 }
Beispiel #10
0
 public GrafoNaoDirigidoBuilder GrafoNaoConexo()
 {
     this.grafo = LeituraArquivo.GrafoNaoDirigido(@"..\..\txts\NaoDirigido\NaoConexo.txt");
     return(this);
 }
Beispiel #11
0
 public GrafoNaoDirigidoBuilder Regular()
 {
     this.grafo = LeituraArquivo.GrafoNaoDirigido(@"..\..\txts\NaoDirigido\Regular.txt");
     return(this);
 }
Beispiel #12
0
 public GrafoNaoDirigidoBuilder AGMKruskal()
 {
     this.grafo = LeituraArquivo.GrafoNaoDirigido(@"..\..\txts\NaoDirigido\Kruskal.txt");
     return(this);
 }
Beispiel #13
0
 public GrafoNaoDirigidoBuilder CutVertices()
 {
     this.grafo = LeituraArquivo.GrafoNaoDirigido(@"..\..\txts\NaoDirigido\NumCutVertice.txt");
     return(this);
 }
Beispiel #14
0
 // Use this for initialization
 void Start()
 {
     todosProjetos     = GameObject.FindGameObjectsWithTag("Projeto");
     leituraArquivo    = GameObject.Find("LeituraArquivo").GetComponent <LeituraArquivo>() as LeituraArquivo;
     telaInicialScript = GameObject.Find("TelaEstacaoTrabalho").transform.FindChild("TelaInicial").GetComponent <TelaInicialScript> () as TelaInicialScript;
 }
 public GrafoDirigidoBuilder GrafoComum()
 {
     this.grafo = LeituraArquivo.GrafoDirigido(@"..\..\txts\Dirigido\ComCiclo.txt");
     return(this);
 }