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.moves; //from w ww . j a v a2s .co m import java.util.List; import com.tum.yahtzee.units.Cube; public class ChanceMove implements IBaseMove { private int points; public static boolean validate(List<Cube> cubes) { return true; } public static int calculatePoints(List<Cube> cubes) { int points = 0; for (Cube cube : cubes) { points += (cube.getNumber()+1); } return points; } public ChanceMove(List<Cube> cubes) { this.points = ChanceMove.calculatePoints(cubes); } public int getPoints() { return points; } public void print() { System.out.println("Chance, Points: "+points); } }