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)); }
public static IList <int> SortearResultado(char codigoTipoAposta) { if (NumerosSorteados == null) { NumerosSorteados = new List <int>(); } BaseTipoApostaNeg tipoApostaNeg = BaseTipoApostaNeg.Instanciar(codigoTipoAposta); NumerosSorteados = tipoApostaNeg.GerarNumerosAleatorios(); return(NumerosSorteados); }
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); }
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)); }