2020-04-17 16:03:59 +02:00
|
|
|
package main;
|
|
|
|
|
|
|
|
import java.util.Collections;
|
2020-04-18 19:39:59 +02:00
|
|
|
import java.util.Stack;
|
2020-04-17 16:03:59 +02:00
|
|
|
|
2020-04-18 19:39:59 +02:00
|
|
|
import carte.CartePiochable;
|
|
|
|
|
|
|
|
public class Pioche<T extends Type> {
|
|
|
|
|
|
|
|
private Stack<CartePiochable<T>> cartesPiochables;
|
|
|
|
|
2020-04-17 16:03:59 +02:00
|
|
|
|
2020-04-18 19:39:59 +02:00
|
|
|
public void melanger()
|
|
|
|
{
|
2020-04-17 16:03:59 +02:00
|
|
|
Collections.shuffle(cartesPiochables);
|
2020-04-18 19:39:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public CartePiochable<?> piocher() {
|
|
|
|
|
|
|
|
return cartesPiochables.pop();
|
2020-04-17 16:03:59 +02:00
|
|
|
}
|
|
|
|
}
|