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 w w. j a v a 2s . com*/ import java.util.LinkedList; import java.util.List; import com.tum.yahtzee.units.Cube; public class YahtzeeMove implements IBaseMove { public static boolean validate(List<Cube> cubes) { List<Integer> items = new LinkedList<Integer>(); for(Cube cube : cubes) { if (!items.contains(cube.getNumber())) { items.add(cube.getNumber()); } } return items.size() == 1; } public static int calculatePoints(List<Cube> cubes) { return 50; } public YahtzeeMove(List<Cube> cubes) { } public int getPoints() { return YahtzeeMove.calculatePoints(null); } public void print() { System.out.println("Yahtzee Move, Points: "+getPoints()); } }