Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package p5;
- import java.util.Random;
- /**
- * Created by Chrille on 2015-11-27.
- */
- public class SimpleDice implements Dice {
- private int sides;
- public SimpleDice() {
- this(6);
- }
- public SimpleDice(int sides){
- this.sides = sides;
- int value = 0;
- boolean inputOK = false;
- do {
- try {
- value = this.sides;
- inputOK = true; }
- catch( NegativeSidesException ) {}
- }
- while( inputOK == false );
- this.sides = sides;
- }
- @Override
- public int throwDice() {
- // TODO Auto-generated method stub
- return 0;
- }
- @Override
- public int getSides() {
- // TODO Auto-generated method stub
- return sides;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement