Exemple #1
0
        public TemposForm(EnumGanhador ganhador, String nomeGanhador, int?tempoGanhador, EnumGanhador segundo, String nomeSegundo, int?tempoSegundo)
        {
            InitializeComponent();
            this.ganhador      = ganhador;
            this.nomeGanhador  = nomeGanhador;
            this.tempoGanhador = tempoGanhador;

            this.segundo      = segundo;
            this.nomeSegundo  = nomeSegundo;
            this.tempoSegundo = tempoSegundo;

            if (tempoGanhador != null)
            {
                Decimal tempoGanhadorDecimal = Decimal.Divide((int)tempoGanhador, 1000);
                lb_ganhador.Text = nomeGanhador + ": " + tempoGanhadorDecimal.ToString() + "s";
            }
            else
            {
                lb_ganhador.Text = nomeGanhador + ": " + 0 + "s";
            }

            if (tempoSegundo != null)
            {
                Decimal tempoSegundoDecimal = Decimal.Divide((int)tempoSegundo, 1000);
                lb_segundo.Text = nomeSegundo + ": " + tempoSegundoDecimal.ToString() + "s";
            }
            else
            {
                lb_segundo.Text = nomeSegundo + ": " + 0 + "s";
            }
        }
        public void setSegundoLugar(EnumGanhador segundo, String nome, int tempo)
        {
            if (this.nomeSegundo == null && this.tempoSegundo == null && segundo != ganhador)
            {
                this.timer_mostrar_tempos.Enabled = true;

                this.segundo      = segundo;
                this.nomeSegundo  = nome;
                this.tempoSegundo = tempo;
            }
        }
 public GanhadorForm(EnumGanhador ganhador, String nome, int tempo)
 {
     InitializeComponent();
     if (ganhador == EnumGanhador.Branco)
     {
         this.BackgroundImage = Properties.Resources.rato_branco_winer;
     }
     else if (ganhador == EnumGanhador.Preto)
     {
         this.BackgroundImage = Properties.Resources.rato_preto_winer;
     }
     else
     {
         this.timer_mostrar_tempos.Interval = 1;
     }
     this.ganhador      = ganhador;
     this.nomeGanhador  = nome;
     this.tempoGanhador = tempo;
     lb_ganhador.Text   = nome;
 }