Пример #1
0
        static void Main(string[] args)
        {
            Telas      T     = new Telas();
            List <int> Pares = new List <int>();

            for (int i = 0; i <= 100; i++)
            {
                if (i % 2 == 0)
                {
                    Pares.Add(i);
                }
            }

            List <int> ImPares = new List <int>();

            for (int i = 0; i < 100; i++)
            {
                if (i % 2 != 0)
                {
                    ImPares.Add(i);
                }
            }

            /////////////////////////////////////////////////////////////////////////////////////////////////////

            T.MenuPrincipal2(Pares, ImPares);
        }
Пример #2
0
        static void Main(string[] args)
        {
            Telas e = new Telas();

            Console.WriteLine("--------------------------------------------------------------------------------------------------------------------\n\n                                              Empresa de confecciones Coltejer\n\n--------------------------------------------------------------------------------------------------------------------");
            Console.WriteLine("\n La inversión a realizar presenta el siguiente detalle:");
            // Tela algodon
            Console.Write($"\n Precio tela Algodón sin aumento: ${e.darFormato(e.getPAlgodon())}");
            e.calcularPrecio("Algodón", 5);
            Console.Write($" | Precio final con aumento del {e.getIncremento()}%: ${e.darFormato(e.getPAlgodon())}");
            Console.Write($" | Cantidad comprada {e.getCantidad()}");
            // Tela lino
            Console.Write($"\n Precio tela Lino sin aumento: ${e.darFormato(e.getPLino())}");
            e.calcularPrecio("Lino", 4);
            Console.Write($" | Precio final con aumento del {e.getIncremento()}%: ${e.darFormato(e.getPLino())}");
            Console.Write($" | Cantidad comprada {e.getCantidad()}");
            // Tela franela
            Console.Write($"\n Precio tela Franela sin aumento: ${e.darFormato(e.getPFranela())}");
            e.calcularPrecio("Franela", 5);
            Console.Write($" | Precio final con aumento del {e.getIncremento()}%: ${e.darFormato(e.getPFranela())}");
            Console.Write($" | Cantidad comprada {e.getCantidad()}");
            // Tela crepe
            Console.Write($"\n Precio tela Crepé sin aumento: ${e.darFormato(e.getPCrepe())}");
            e.calcularPrecio("Crepé", 4);
            Console.Write($" |Precio final con aumento del {e.getIncremento()}%: ${e.darFormato(e.getPCrepe())}");
            Console.Write($" | Cantidad comprada {e.getCantidad()}\n");
            // Total
            Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------\n");
            Console.WriteLine($" El precio total a invertir es: ${e.darFormato(e.getPTotal())}");
            Console.WriteLine("\n--------------------------------------------------------------------------------------------------------------------\n");

            Console.ReadKey();
        }
Пример #3
0
        /// <summary>
        /// Método que fecha a tela
        /// </summary>
        /// <param name="tag"></param>
        public void FecharTela(Telas tag)
        {
            Util.CL_Files.WriteOnTheLog("FO_Principal.FecharTela()", Util.Global.TipoLog.DETALHADO);

            if (pages.Count - 1 > 0)
            {
                this.tbc_table_control.SelectedIndex = pages.Count - 2;
            }

            int index = 0;

            foreach (TabPage p in pages)
            {
                if ((int)p.Tag == (int)tag)
                {
                    p.Dispose();
                    break;
                }
                else
                {
                    index++;
                }
            }

            if (index < pages.Count)
            {
                pages.RemoveAt(index);
            }
        }
Пример #4
0
 public void Next()
 {
     if (telas == Telas.Arestas)
     {
         telas = Telas.Rota;
     }
     else if (telas == Telas.Rota)
     {
         if (PontoPartida != null && PontoChegada != null)
         {
             telas   = Telas.IA;
             ChamaIA = true;
         }
     }
     else if (telas == Telas.Fim)
     {
         if (janeMatriz == JaneMatriz.Nenhum)
         {
             janeMatriz = JaneMatriz.MAtriz;
         }
         else if (janeMatriz == JaneMatriz.MAtriz)
         {
             janeMatriz = JaneMatriz.Rota;
         }
         else if (janeMatriz == JaneMatriz.Rota)
         {
             janeMatriz = JaneMatriz.Nenhum;
         }
     }
 }
Пример #5
0
        /// <summary>
        /// Método que abre a janela de cadastro de projeto
        /// </summary>
        public void AbrirJanelaDeCadastro(int codigo, int numtarefa, Util.Enumerator.Tarefa tarefa)
        {
            Util.CL_Files.WriteOnTheLog("FO_Principal.AbrirJanelaDeCadastro()", Util.Global.TipoLog.DETALHADO);
            Telas tela = tarefa == Tarefa.INCLUINDO ? Telas.CADASTRO_PROJETO_INCLUIR : Telas.CADASTRO_PROJETO;

            AbreJanela(new Visão.UC_CadastroProjeto(this, codigo, numtarefa, tarefa, tela), "Cadastro - Projeto", tela);
        }
Пример #6
0
 // Métodos estáticos
 public static void CarregarTelaEstatico(Telas tela)
 {
     telaAnterior = telaAtual;
     telaAtual    = tela;
     Debug.Log("AQUI estatico " + tela);
     Application.LoadLevel(Dados.nomeTelas[(int)tela]);
     UnityAnalytics.EnviarPontosMaisTocados();
 }
Пример #7
0
    public void CarregarTela(Telas tela, bool tocarSom = true)
    {
        if (tocarSom && som && Dados.somLigado)
        {
            Instantiate(som, Vector3.zero, Quaternion.identity);
        }

        telaAtual = tela;
        Debug.Log("AQUI " + tela);
        Application.LoadLevel(Dados.nomeTelas[(int)tela]);
        UnityAnalytics.EnviarPontosMaisTocados();
    }
Пример #8
0
        /// <summary>
        /// Método que abre uma nova aba no tab page
        /// </summary>
        /// <param name="control">User control a ser aberto dentro da page</param>
        /// <param name="titulo">Título da aba da página a ser aberta</param>
        private void AbreJanela(UserControl control, string titulo, Telas tag)
        {
            Util.CL_Files.WriteOnTheLog("FO_Principal.AbreJanela()", Util.Global.TipoLog.DETALHADO);

            int   index      = 0;
            Telas tag_aberto = Telas.CADASTRO_ENTRADA;
            bool  aberto     = false;

            foreach (TabPage p in pages)
            {
                if ((int)p.Tag == (int)tag)
                {
                    tag_aberto = (Telas)p.Tag;
                    aberto     = true;
                    break;
                }
                else
                {
                    index++;
                }
            }

            if (aberto)
            {
                FecharTela(tag_aberto);
            }
            TabPage page = new TabPage(titulo);

            TabPage tabPage1 = new TabPage(titulo);

            tabPage1.Tag = (int)tag;
            pages.Add(tabPage1);

            tabPage1.Controls.Add(control);
            this.tbc_table_control.Controls.Add(tabPage1);
            this.tbc_table_control.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tbc_table_control.Name = titulo;

            index = 0;
            foreach (TabPage p in this.tbc_table_control.Controls)
            {
                if ((int)p.Tag == (int)tag)
                {
                    break;
                }
                index++;
            }

            this.tbc_table_control.TabIndex      = index;
            this.tbc_table_control.SelectedIndex = index;
        }
 // a cada frame do jogo
 void Update()
 {
     // se o jogador pressionar a tecla de espaco
     if (Input.GetKeyDown(KeyCode.Space)){
         // dependendo de qual eh a tela atual, carrega uma Cena diferente
         switch (telaAtual) {
         case Telas.Primeira :
             telaAtual = Telas.Segunda; // muda a variavel de controle
             Application.LoadLevel("SegundaCena"); // carrega proxima tela
             break;
         case Telas.Segunda :
             telaAtual = Telas.Primeira;
             Application.LoadLevel("PrimeiraCena");
             break;
         }
     }
 }
Пример #10
0
 public void Back()
 {
     if (telas == Telas.Arestas)
     {
         telas = Telas.Menu;
     }
     else if (telas == Telas.Rota)
     {
         telas = Telas.Arestas;
     }
     else if (telas == Telas.Fim)
     {
         telas = Telas.Rota;
     }
     else if (telas == Telas.IA)
     {
         telas = Telas.Rota;
     }
 }
Пример #11
0
        static void Main(string[] args)
        {
            int op = 1;

            Telas view = new Telas();

            while (op != 0)
            {
                op = view.telaPrincipal();
                Console.Clear();
                switch (op)
                {
                case 1:
                    view.fazerLogin();
                    break;

                case 2:
                    view.visualizaRodadas();
                    break;

                case 3:
                    view.selecionaEstatisticas();
                    break;

                case 4:
                    view.visualizaClassificacao();
                    break;

                case 0:
                    Console.WriteLine("Programa encerrado!");
                    break;

                default:
                    Console.WriteLine("Opção inválida.");
                    break;
                }
            }
        }
Пример #12
0
    public static void CarregarTela(Telas tela, Navegacao nav)
    {
        podeMover = false;

        nav.CarregarTelaMenuVirandoPagina();

        switch (tela)
        {
        case Telas.EscolherFase:
        case Telas.EscolherMundo:
            switch (Dados.modoDeJogo)
            {
            case ModosDeJogo.Normal:
                _instancia.TelaEscolherMundo();
                break;

            case ModosDeJogo.JogoRapido:
            case ModosDeJogo.Sobrevivencia:
                _instancia.TelaJogoRapido();
                break;

            default:
                _instancia.TelaMenu();
                break;
            }
            break;

        case Telas.EscolherJogo:
            _instancia.TelaModoJogo();
            break;

        default:
            _instancia.TelaMenu();
            break;
        }
    }
Пример #13
0
 /// <summary>
 /// Construtor da classe
 /// </summary>
 public UC_CadastroProjeto(FO_Principal principal, int codigo_projeto, int numtarefa, Tarefa tarefa, Telas tela)
 {
     Util.CL_Files.WriteOnTheLog("UC_CadastroEstimativa.UC_CadastroProjeto()", Util.Global.TipoLog.DETALHADO);
     this.Tag       = (int)tela;
     this.principal = principal;
     project        = new MD_Project(codigo_projeto, numtarefa);
     this.tarefa    = tarefa;
     IniciaUserControl();
 }
Пример #14
0
        /// <summary>
        /// Construtor principal da classe
        /// </summary>
        /// <param name="principal">Instância da tela que abriu o user control</param>
        /// <param name="project">Projeto referente o cenário de teste</param>
        /// <param name="cenario">Cenário de teste que dará o load da classe</param>
        /// <param name="tarefa">Tarefa a ser executada na tela</param>
        /// <param name="tela">Código da tela</param>
        public UC_CadastroCenarios(FO_Principal principal, MD_Project project, MD_Cenario cenario, Tarefa tarefa, Telas tela, TipoSistema sistema)
        {
            Util.CL_Files.WriteOnTheLog("UC_CadastroCenarios.UC_CadastroCenarios()", Util.Global.TipoLog.DETALHADO);
            this.principal = principal;
            this.project   = project;
            this.cenario   = cenario;
            this.tarefa    = tarefa;
            this.Tag       = (int)tela;

            InitializeComponent();
            CarregaForm();
            PopulaCampos(sistema);
        }
Пример #15
0
        static void Main(string[] args)
        {
            int opcao = 0;

            // INICIANDO AS MARCAS:
            Marca m1 = new Marca(1001, "Volkswagen", "Alemanha");
            Marca m2 = new Marca(1002, "General Motors", "Estados Unidos");

            // INICIANDO OS CARROS
            Carro c1 = new Carro(101, "Fusca", 1980, 5000.00, m1);

            m1.addCarro(c1);
            Carro c2 = new Carro(102, "Golf", 2016, 60000.00, m1);

            m1.addCarro(c2);
            Carro c3 = new Carro(103, "Fox", 2017, 30000.00, m1);

            m1.addCarro(c3);
            Carro c4 = new Carro(104, "Cruze", 2016, 30000.00, m2);

            m2.addCarro(c4);
            Carro c5 = new Carro(105, "Cobalt", 2015, 25000.00, m2);

            m2.addCarro(c5);
            Carro c6 = new Carro(106, "Cobalt", 2017, 35000.00, m2);

            m2.addCarro(c6);

            // ARMAZENANDO AS MARCAS E CARROS NAS LISTAS LOCAIS DO PROGRAMA:
            marcas.Add(m1);
            marcas.Add(m2);
            carros.Add(c1);
            carros.Add(c2);
            carros.Add(c3);
            carros.Add(c4);
            carros.Add(c5);
            carros.Add(c6);

            //carros.Sort();

            while (opcao != 7)
            {
                Telas.mostrarOpcoes();
                try {
                    opcao = int.Parse(Console.ReadLine());
                } catch (Exception e) {
                    Console.WriteLine("Erro inesperado: " + e.Message);
                    opcao = 0;
                }
                Console.WriteLine();

                if (opcao == 1)
                {
                    Telas.mostrarMarcas();
                }
                else if (opcao == 2)
                {
                    Telas.mostrarCarrosDeUmaMarca();
                }
                else if (opcao == 3)
                {
                    try {
                        Telas.cadastrarMarca();
                    } catch (Exception e) {
                        Console.WriteLine("Erro inesperado: " + e.Message);
                    }
                }
                else if (opcao == 4)
                {
                    try {
                        Telas.cadastrarCarro();
                    } catch (ModelException e) {
                        Console.WriteLine("Erro de negócio: " + e.Message);
                    } catch (Exception e) {
                        Console.WriteLine("Erro inesperado: " + e.Message);
                    }
                }
                else if (opcao == 5)
                {
                    try {
                        Telas.cadastrarAcessorio();
                    } catch (Exception e) {
                        Console.WriteLine("Erro inesperado: " + e.Message);
                    }
                }
                else if (opcao == 6)
                {
                    try {
                        Telas.mostrarCarro(carros);
                    } catch (ModelException e) {
                        Console.WriteLine("Erro de negócio: " + e.Message);
                    } catch (Exception e) {
                        Console.WriteLine("Erro inesperado: " + e.Message);
                    }
                }
                else if (opcao == 7)
                {
                    Console.WriteLine("Fim do programa!");
                }
                else
                {
                    Console.WriteLine("Opção inválida!");
                }
                Console.WriteLine();
            }
            Console.WriteLine("\nPressione ENTER para sair\n");
            Console.ReadLine();
        }
Пример #16
0
 public void SetCurrentState(Telas tela)
 {
     this.telaAtual = tela;
 }
Пример #17
0
        protected override void Initialize()
        {
            player = new Player();
            cube = new Cube(new Vector3(0, .5f, -3));
            plano = new Plano(GraphicsDevice);

            // Cria a "chasing camera", que segue o cubo
            InicializaCamera(graphics.GraphicsDevice);

            telas = new Telas();
            timeRect = new Rectangle(700, 40, 25, 100);
            botoes = new Botoes();

            base.Initialize();
        }
Пример #18
0
        /// <summary>
        /// Construtor principal da classe
        /// </summary>
        /// <param name="principal">Tela principal que chamou o usercontrol</param>
        /// <param name="estimativa">Model estimativa</param>
        /// <param name="tarefa">Tarefa a se fazer</param>
        /// <param name="tela">Tag da tela</param>
        public UC_CadastroEstimativa(FO_Principal principal, MD_Estimativa estimativa, Tarefa tarefa, Telas tela)
        {
            Util.CL_Files.WriteOnTheLog("UC_CadastroEstimativa.UC_CadastroEstimativa()", Util.Global.TipoLog.DETALHADO);
            this.principal  = principal;
            this.estimativa = estimativa;
            this.tarefa     = tarefa;
            this.Tag        = (int)tela;

            IniciaUserControl();
        }
Пример #19
0
 // Update is called once per frame
 void Update()
 {
     if (telas == Telas.Menu)
     {
         NumeroAresta = 0;
         GameObject lixo = GameObject.FindGameObjectWithTag("Vertices");
         Destroy(lixo);
         Enter = true;
     }
     else if (telas == Telas.Grade)
     {
         if (Enter)
         {
             Enter = false;
             Passx = (DeltaX / (NumeroColunas - 1));
             PassY = (DeltaY / (NumeroLinhas - 1));
             for (int i = 0; i < NumeroColunas; i++)
             {
                 for (int j = 0; j < NumeroLinhas; j++)
                 {
                     Vector3 Posicao = new Vector3(PontoXo + (i * Passx), PontoYo + (j * PassY), 0);
                     SpriteVertices.name = Nomes[(i * NumeroLinhas) + j];
                     SpriteVertices.GetComponent <MyNameIs>().IndexVert = (i * NumeroLinhas) + j;
                     Grafo[(i * NumeroLinhas) + j] =
                         Instantiate(SpriteVertices, Posicao, Quaternion.identity);
                     Cleaner++;
                 }
             }
         }
         else
         {
             telas = Telas.Arestas;
         }
     }
     else if (telas == Telas.Arestas)
     {
         #region Criar VERTICES
         for (int i = 0; i < NumeroColunas * NumeroLinhas; i++)
         {
             bool TaSozinho = true;
             for (int j = 0; j < NumeroColunas * NumeroLinhas; j++)
             {
                 if (i != j)
                 {
                     GameObject pai, filho;
                     if (i < j)
                     {
                         pai   = Grafo[i];
                         filho = Grafo[j];
                     }
                     else
                     {
                         pai   = Grafo[j];
                         filho = Grafo[i];
                     }
                     for (int k = 0; k < pai.GetComponent <MyNameIs>().Vizinho.Length; k++)
                     {
                         if (pai.GetComponent <MyNameIs>().Vizinho[k] == filho)
                         {
                             TaSozinho = false;
                         }
                     }
                 }
             }
             if (TaSozinho && Grafo[i].GetComponent <SpriteRenderer>().color != Color.black)
             {
                 Grafo[i].GetComponent <SpriteRenderer>().color = Color.white;
             }
         }
         #endregion
         for (int p = 0; p < NumeroColunas * NumeroLinhas; p++)
         {
             coutg = p;
             if (Grafo[p].GetComponent <SpriteRenderer>().color != Color.red)
             {
                 break;
             }
         }
     }
     else if (telas == Telas.Rota)
     {
         for (int i = 0; i < NumeroColunas * NumeroLinhas; i++)
         {
             if (Grafo[i] == PontoChegada)
             {
                 PontoChegada.GetComponent <SpriteRenderer>().color = Color.blue;
             }
             else if (Grafo[i] == PontoPartida)
             {
                 PontoPartida.GetComponent <SpriteRenderer>().color = Color.green;
             }
             else
             {
                 Grafo[i].GetComponent <SpriteRenderer>().color = Color.red;
             }
         }
     }
     else if (telas == Telas.IA)
     {
         if (ChamaIA)
         {
             ChamaIA = false;
             GetComponent <IA>().CalcularRota(PontoPartida, PontoChegada, Grafo);
         }
     }
     else if (telas == Telas.Fim)
     {
         for (int i = 0; i < Grafo.Length; i++)
         {
             if (Grafo[i] != null)
             {
                 Grafo[i].GetComponent <SpriteRenderer>().color = Color.white;
             }
         }
     }
     Atualiza();
 }
Пример #20
0
 public void Play()
 {
     telas = Telas.Grade;
 }