From 4a98975b0da4baa4158140ba85f39ffa669ba7a8 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Tue, 24 May 2011 01:51:56 +0200 Subject: Calculate points on hand git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@264 72836036-5685-4462-b002-a69064685172 --- mock/jrummikub/model/MockHand.java | 6 ++++++ mock/jrummikub/model/MockPlayer.java | 4 ++-- mock/jrummikub/model/MockRoundState.java | 14 +++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) (limited to 'mock') diff --git a/mock/jrummikub/model/MockHand.java b/mock/jrummikub/model/MockHand.java index 30bda51..c69ae7b 100644 --- a/mock/jrummikub/model/MockHand.java +++ b/mock/jrummikub/model/MockHand.java @@ -76,4 +76,10 @@ public class MockHand implements IHand { // TODO Auto-generated method stub return 0; } + + @Override + public int getStonePoints() { + // TODO Auto-generated method stub + return 0; + } } diff --git a/mock/jrummikub/model/MockPlayer.java b/mock/jrummikub/model/MockPlayer.java index a7b57b4..19c7014 100644 --- a/mock/jrummikub/model/MockPlayer.java +++ b/mock/jrummikub/model/MockPlayer.java @@ -15,8 +15,8 @@ public class MockPlayer implements IPlayer { * @param playerSettings * the player settings */ - public MockPlayer(PlayerSettings playerSettings) { - hand = new Hand(); + public MockPlayer(PlayerSettings playerSettings, GameSettings gameSettings) { + hand = new Hand(gameSettings); this.playerSettings = playerSettings; laidOut = false; } diff --git a/mock/jrummikub/model/MockRoundState.java b/mock/jrummikub/model/MockRoundState.java index 0341f27..ee483c6 100644 --- a/mock/jrummikub/model/MockRoundState.java +++ b/mock/jrummikub/model/MockRoundState.java @@ -22,15 +22,19 @@ public class MockRoundState implements IRoundState { public GameSettings gameSettings; /** */ public IPlayer lastPlayer; - + /** */ public MockRoundState() { table = new MockTable(); players = new ArrayList(); - players.add(new MockPlayer(new PlayerSettings("Player 1", Color.RED))); - players.add(new MockPlayer(new PlayerSettings("Player 2", Color.YELLOW))); - players.add(new MockPlayer(new PlayerSettings("Player 3", Color.GREEN))); - players.add(new MockPlayer(new PlayerSettings("Player 4", Color.BLACK))); + players.add(new MockPlayer(new PlayerSettings("Player 1", Color.RED), + gameSettings)); + players.add(new MockPlayer( + new PlayerSettings("Player 2", Color.YELLOW), gameSettings)); + players.add(new MockPlayer(new PlayerSettings("Player 3", Color.GREEN), + gameSettings)); + players.add(new MockPlayer(new PlayerSettings("Player 4", Color.BLACK), + gameSettings)); activePlayer = 0; gameHeap = new StoneHeap(); gameSettings = new GameSettings(); -- cgit v1.2.3