StoneSet, nicht fertig, aber kompilierfähig
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@28 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
e4bc09a6ad
commit
bc774c639b
1 changed files with 28 additions and 0 deletions
|
@ -1,13 +1,24 @@
|
||||||
package jrummikub.model;
|
package jrummikub.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import jrummikub.util.Pair;
|
import jrummikub.util.Pair;
|
||||||
|
|
||||||
/** Class managing {@link Stone}s joined together to form sets */
|
/** Class managing {@link Stone}s joined together to form sets */
|
||||||
public class StoneSet {
|
public class StoneSet {
|
||||||
private List<Stone> stones;
|
private List<Stone> stones;
|
||||||
|
|
||||||
|
public StoneSet(Stone stone) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public StoneSet(List<Stone> stones) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/** Test for rule conflict within the StoneSet */
|
/** Test for rule conflict within the StoneSet */
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +30,14 @@ public class StoneSet {
|
||||||
* Splitting {@link Position}
|
* Splitting {@link Position}
|
||||||
*/
|
*/
|
||||||
public Pair<StoneSet, StoneSet> splitAt(int position) {
|
public Pair<StoneSet, StoneSet> splitAt(int position) {
|
||||||
|
//Exception falls falscher index
|
||||||
|
if (position==0||position==stones.size()){
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +48,16 @@ public class StoneSet {
|
||||||
* StoneSet to be joined to active StoneSet
|
* StoneSet to be joined to active StoneSet
|
||||||
*/
|
*/
|
||||||
public StoneSet join(StoneSet other) {
|
public StoneSet join(StoneSet other) {
|
||||||
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int size() {
|
||||||
|
return stones.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Stone get(int i) {
|
||||||
|
return stones.get(i);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue