示例#1
0
        public static RegistrarApostaClass Surpresinha(char codigoTipoAposta)
        {
            BaseTipoApostaNeg    tipoApostaNeg = BaseTipoApostaNeg.Instanciar(codigoTipoAposta);
            RegistrarApostaClass aposta        = new RegistrarApostaClass()
            {
                CodigoTipoAposta = codigoTipoAposta,
                Numeros          = tipoApostaNeg.GerarNumerosAleatorios().ToArray()
            };

            return(RegistrarNovaAposta(aposta, tipoApostaNeg));
        }
示例#2
0
        public static IList <int> SortearResultado(char codigoTipoAposta)
        {
            if (NumerosSorteados == null)
            {
                NumerosSorteados = new List <int>();
            }

            BaseTipoApostaNeg tipoApostaNeg = BaseTipoApostaNeg.Instanciar(codigoTipoAposta);

            NumerosSorteados = tipoApostaNeg.GerarNumerosAleatorios();

            return(NumerosSorteados);
        }
示例#3
0
        public static IList <int> ObterNumerosSorteados(char codigoTipoAposta)
        {
            BaseTipoApostaNeg tipoApostaNeg = BaseTipoApostaNeg.Instanciar(codigoTipoAposta);

            if (NumerosSorteados == null)
            {
                NumerosSorteados = new List <int>();

                for (int i = 0; i < tipoApostaNeg.TipoAposta.QuantidadeNumeros; i++)
                {
                    NumerosSorteados.Add(0);
                }
            }
            return(NumerosSorteados);
        }
示例#4
0
        public static RegistrarApostaClass RegistrarNovaAposta(RegistrarApostaClass _aposta, BaseTipoApostaNeg _tipoApostaNeg = null)
        {
            BaseTipoApostaNeg tipoApostaNeg = _tipoApostaNeg ?? BaseTipoApostaNeg.Instanciar(_aposta.CodigoTipoAposta);

            if (ApostasList == null)
            {
                ApostasList = new List <Aposta>();
            }

            Aposta aposta = new Aposta()
            {
                Id         = ApostasList.Count + 1,
                Data       = DateTime.Now,
                Numeros    = _aposta.Numeros?.OrderBy(x => x).ToList(),
                TipoAposta = tipoApostaNeg.TipoAposta
            };

            tipoApostaNeg.ValidarAposta(aposta);

            ApostasList.Add(aposta);

            return(new RegistrarApostaClass(aposta));
        }