diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..0108b60 Binary files /dev/null and b/.DS_Store differ diff --git a/Facade/Game.java b/Facade/Game.java index 5fe6acd..4d205f6 100644 --- a/Facade/Game.java +++ b/Facade/Game.java @@ -10,7 +10,6 @@ public class Game { private int numberOfDice; private Dice dice = new Dice(numberOfDice); private int[] diceValues; - private Player player1; private Yatzy_Sheet sheet = new Yatzy_Sheet(); private Ones ones = new Ones(); @@ -30,11 +29,20 @@ public class Game { public void startgame(int playerCount, String[] name, int numberOfDice){ for(int i = 0; i < playerCount; i++){ - player1 = new Player(name[i], sheet, dice); + Player player1 = new Player(name[i], sheet, dice); players.add(player1); } } + // public void startgame(int playerCount, String[] name, int numberOfDice){ + // this.numberOfDice = numberOfDice; + // dice = new Dice(numberOfDice); + // for(int i = 0; i < playerCount; i++){ + // Player player = new Player(name[i], sheet, dice); + // players.add(player); + // } + // } + public int[] rollDice(Dice dice){ dice.rollDice(numberOfDice); int[] diceValues = dice.getValues(); @@ -119,4 +127,24 @@ public class Game { } return ""; } + + public String getCategoryNames(){ + String[] categorynames = new String[13]; + + categorynames[0] = "Ones"; + categorynames[1] = "Twos"; + categorynames[2] = "Threes"; + categorynames[3] = "Fours"; + categorynames[4] = "Fives"; + categorynames[5] = "Sixes"; + categorynames[6] = "Two Pairs"; + categorynames[7] = "Three Pairs"; + categorynames[8] = "Four Pairs"; + categorynames[9] = "Full House"; + categorynames[10] = "Straight Flush"; + categorynames[11] = "Royal Straight Flush"; + categorynames[12] = "Yatzy"; + + return categorynames.toString(); + } } diff --git a/UI/Main.java b/UI/Main.java new file mode 100644 index 0000000..3d26db3 --- /dev/null +++ b/UI/Main.java @@ -0,0 +1,14 @@ +package UI; + +import Facade.Game; + +public class Main { + public static void main(String[] args){ + Game game = new Game(); + String[] names = new String[2]; + names[0] = "Jens"; + names[1] = "mike"; + game.startgame(2,names , 6); + System.out.println(game.getPlayerName(0)); + } +}