Advertisement
ddx99

Untitled

Apr 1st, 2020
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. public class Die {
  2.  
  3.   private Random  generator = new Random();
  4.   private int faceValue;
  5.   private boolean isBlocked;
  6.  
  7.   public Die(){
  8.  isBlocked=false;
  9.  faceValue=generator.nextInt(6)+1;
  10.  }
  11.  
  12.   public boolean isBlocked() {
  13.  
  14.     return false;
  15.   }
  16.  
  17.   public void unblock() {
  18.     isBlocked=false;
  19.  
  20.   }
  21.  
  22.   public void block() {
  23.     isBlocked=true;
  24.  
  25.   }
  26.  
  27.   public int value() {
  28.     return this.faceValue;
  29.   }
  30.   public void roll(){
  31.       this.faceValue=generator.nextInt(6)+1;
  32.  
  33.  
  34.  
  35.      //faceValue=generator.nextInt(6)+1;
  36.  
  37.   }
  38. }
  39.  
  40. public class DiceHand {
  41.     private List<Integer> faces=new ArrayList<Integer>();
  42.  
  43.  
  44.     public DiceHand(List<Die> dice) {
  45.  
  46.     }
  47.  
  48.     public int get(int die ){
  49.  
  50.         return die;
  51.     }
  52.     public int sum(){
  53.          int sum=0;
  54.          sum=sum+Die.value()
  55.  
  56.  
  57.         return
  58.     }
  59.     public int count(int faceValue){
  60.  
  61.         return faceValue;
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement