You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
810 B
34 lines
810 B
/* |
|
* 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. |
|
*/ |
|
package gazstation2; |
|
|
|
import java.util.Random; |
|
|
|
/** |
|
* |
|
* @author denis |
|
*/ |
|
class GazProducer extends Thread{ |
|
private FilingColumn column; |
|
|
|
public GazProducer(FilingColumn column){ |
|
this.column = column; |
|
} |
|
|
|
@Override |
|
public void run() { |
|
System.out.println("Бензовоз выехал"); |
|
call(); |
|
} |
|
|
|
void call() { |
|
int fuel = (new Random().nextInt(4)+1)*100; |
|
column.addFuel(fuel); |
|
System.out.println("Бензовоз залил " + fuel + " л., Остаток = " + column.getBigTank()); |
|
|
|
} |
|
|
|
}
|
|
|