Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
638 B
4
Indexable
Never
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author kevinpg
 */
public class Jugador extends Thread {

    private int id;
    private Arbitro arbitro;

    public Jugador(int id, Arbitro arbitro) {
        this.id = id;
        this.arbitro = arbitro;
    }

    @Override
    public void run() {
        int numero;
        while (!arbitro.isAcabado()) {
            numero = (int) (Math.random() * 10) + 1;
            arbitro.comprobarNumeroAleatorio(numero, id);
        }
    }

}