01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package eg.bowling.fixtures;
04:
05: import fit.ColumnFixture;
06: import eg.bowling.*;
07:
08: public class GameTiming extends ColumnFixture {
09: private Bowling game;
10: public String pins;
11:
12: public GameTiming() {
13: super ();
14: game = new BowlingGame();
15: }
16:
17: public boolean roll() {
18: if (pins.equals("-"))
19: return false;
20: else {
21: game.roll(Integer.parseInt(pins));
22: return true;
23: }
24: }
25:
26: public int currentFrame() {
27: return game.currentFrame();
28: }
29:
30: public int currentBall() {
31: return game.currentBall();
32: }
33:
34: public int scorableFrame() {
35: return game.scoreableFrame();
36: }
37:
38: public int currentScore() {
39: return game.score(game.scoreableFrame());
40: }
41:
42: public boolean validGame() {
43: return game.validGame();
44: }
45:
46: public boolean gameOver() {
47: return game.gameOver();
48: }
49:
50: }
|