Back to project page yahtzee4android.
The source code is released under:
GNU General Public License
If you think the Android project yahtzee4android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.tum.yahtzee.units; // ww w .j ava2 s. c o m public class Cube { private int number; private boolean used; public Cube() { unflag(); shake(); } public void shake() { if (!used) { number = (int)Math.round(Math.random() * 5.0); // 0-5 = 6 possibilities } } public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } public void setUsed(boolean used) { this.used = used; } public boolean getUsed() { return used; } public void unflag() { this.used = false; } }