コード例 #1
0
        public TargetRepository()
        {
            destinos = new List <DestinoPassagem>();
            Fortaleza    fortaleza    = new Fortaleza(new PassagemBase());
            RioDeJaneiro rioDeJaneiro = new RioDeJaneiro(new PassagemBase());
            SaoPaulo     saoPaulo     = new SaoPaulo(new PassagemBase());

            destinos.Add(fortaleza);
            destinos.Add(rioDeJaneiro);
            destinos.Add(saoPaulo);
        }
コード例 #2
0
        private void SemearLocalidades(Contexto context)
        {
            var estados     = (Configuracoes.Recuperar("ESTADOS") as string).ToUpper();
            var nordeste    = Convert.ToBoolean(Configuracoes.Recuperar("ESTADOS_NORDESTE"));
            var norte       = Convert.ToBoolean(Configuracoes.Recuperar("ESTADOS_NORTE"));
            var sul         = Convert.ToBoolean(Configuracoes.Recuperar("ESTADOS_SUL"));
            var sudeste     = Convert.ToBoolean(Configuracoes.Recuperar("ESTADOS_SUDESTE"));
            var centrooeste = Convert.ToBoolean(Configuracoes.Recuperar("ESTADOS_CENTROOESTE"));

            context.Pais.AddOrUpdate(
                p => p.CodPais,
                new Pais {
                CodPais = 1, Descricao = "Brasil", Sigla = "BRA"
            }
                );

            #region Nordeste

            if (nordeste || estados.Contains("AL"))
            {
                Alagoas.Semear(context);
            }
            if (nordeste || estados.Contains("BA"))
            {
                Bahia.Semear(context);
            }
            if (nordeste || estados.Contains("CE"))
            {
                Ceara.Semear(context);
            }
            if (nordeste || estados.Contains("MA"))
            {
                Maranhao.Semear(context);
            }
            if (nordeste || estados.Contains("PB"))
            {
                Paraiba.Semear(context);
            }
            if (nordeste || estados.Contains("PE"))
            {
                Pernambuco.Semear(context);
            }
            if (nordeste || estados.Contains("PI"))
            {
                Piaui.Semear(context);
            }
            if (nordeste || estados.Contains("RN"))
            {
                RioGrandeDoNorte.Semear(context);
            }
            if (nordeste || estados.Contains("SE"))
            {
                Sergipe.Semear(context);
            }

            #endregion Nordeste

            #region Sudeste

            if (sudeste || estados.Contains("MG"))
            {
                MinasGerais.Semear(context);
            }
            if (sudeste || estados.Contains("ES"))
            {
                EspiritoSanto.Semear(context);
            }
            if (sudeste || estados.Contains("RJ"))
            {
                RioDeJaneiro.Semear(context);
            }
            if (sudeste || estados.Contains("SP"))
            {
                SaoPaulo.Semear(context);
            }

            #endregion Sudeste

            #region CentroOeste

            if (centrooeste || estados.Contains("GO"))
            {
                Goias.Semear(context);
            }
            if (centrooeste || estados.Contains("MT"))
            {
                MatoGrosso.Semear(context);
            }
            if (centrooeste || estados.Contains("MS"))
            {
                MatoGrossoDoSul.Semear(context);
            }

            #endregion CentroOeste

            #region Norte

            if (norte || estados.Contains("AC"))
            {
                Acre.Semear(context);
            }
            if (norte || estados.Contains("AP"))
            {
                Amapa.Semear(context);
            }
            if (norte || estados.Contains("AM"))
            {
                Amazonas.Semear(context);
            }
            if (norte || estados.Contains("PA"))
            {
                Para.Semear(context);
            }
            if (norte || estados.Contains("RO"))
            {
                Rondonia.Semear(context);
            }
            if (norte || estados.Contains("RR"))
            {
                Roraima.Semear(context);
            }
            if (norte || estados.Contains("TO"))
            {
                Tocantins.Semear(context);
            }

            #endregion Norte

            #region Sul

            if (sul || estados.Contains("RS"))
            {
                RioGrandeDoSul.Semear(context);
            }
            if (sul || estados.Contains("PR"))
            {
                Parana.Semear(context);
            }
            if (sul || estados.Contains("SC"))
            {
                SantaCatarina.Semear(context);
            }

            #endregion Sul

            if (estados.Contains("DF"))
            {
                DestritoFederal.Semear(context);
            }
        }
コード例 #3
0
        private void reset()// reseta todos os pontos para proxima fase
        {
            saoPaulo      = new SaoPaulo();
            bahia         = new Bahia();
            caribe        = new Caribe();
            usa_leste     = new USA_Leste();
            usa_oeste     = new USA_Oeste();
            japao         = new Japao();
            china         = new China();
            tailandia     = new Tailandia();
            australia     = new Australia();
            unitedKingdom = new UnitedKingdom();
            africaCentral = new AfricaCentral();
            africaSul     = new AfricaSul();
            india         = new India();

            saoPaulo.getCondicao(true);
            bahia.getCondicao(true);
            caribe.getCondicao(true);
            usa_leste.getCondicao(true);
            usa_oeste.getCondicao(true);
            japao.getCondicao(true);
            china.getCondicao(true);
            tailandia.getCondicao(true);
            australia.getCondicao(true);
            unitedKingdom.getCondicao(true);
            africaCentral.getCondicao(true);
            africaSul.getCondicao(true);
            india.getCondicao(true);
            europaLeste.getCondicao(true);
            europaOeste.getCondicao(true);

            saoPaulo.getBloquedo(false);
            bahia.getBloquedo(false);
            caribe.getBloquedo(false);
            usa_leste.getBloquedo(false);
            usa_oeste.getBloquedo(false);
            japao.getBloquedo(false);
            china.getBloquedo(false);
            tailandia.getBloquedo(false);
            australia.getBloquedo(false);
            unitedKingdom.getBloquedo(false);
            africaCentral.getBloquedo(false);
            africaSul.getBloquedo(false);
            india.getBloquedo(false);
            europaLeste.getBloquedo(false);
            europaOeste.getBloquedo(false);

            saoPaulo.get_pct(pctSaoPaulo);
            bahia.get_pct(pctBahia);
            caribe.get_pct(pctCaribe);
            usa_leste.get_pct(pct_USA_Leste);
            usa_oeste.get_pct(pct_USA_Oeste);
            japao.get_pct(pctJapao);
            china.get_pct(pctChina);
            tailandia.get_pct(pctTailandia);
            australia.get_pct(pctAustralia);
            unitedKingdom.get_pct(pct_UnitedKingdom);
            africaCentral.get_pct(pctAfricaCenter);
            africaSul.get_pct(pctAfricaSul);
            india.get_pct(pctIndia);
            europaLeste.get_pct(pctEuropaLeste);
            europaOeste.get_pct(pctEuropaOeste);

            saoPaulo.mudarPonto();
            bahia.mudarPonto();
            caribe.mudarPonto();
            usa_leste.mudarPonto();
            usa_oeste.mudarPonto();
            japao.mudarPonto();
            china.mudarPonto();
            tailandia.mudarPonto();
            australia.mudarPonto();
            unitedKingdom.mudarPonto();
            africaCentral.mudarPonto();
            africaSul.mudarPonto();
            india.mudarPonto();
            europaOeste.mudarPonto();
            europaLeste.mudarPonto();
        }