Skip to content

Commit daf7639

Browse files
committed
Update design.md
1 parent 859c322 commit daf7639

1 file changed

Lines changed: 35 additions & 46 deletions

File tree

design.md

Lines changed: 35 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -44,59 +44,48 @@ classDiagram
4444
Application <|-- Frame
4545
Application <|-- ScoreCard
4646
Application : +array frames
47-
Application : +int current_frame
48-
Application : +int current_ball
47+
Application : +object gameplay
4948
Application : +run()
5049
Application : +create_frames()
5150
class Frame{
52-
+int frame_number
53-
+int ball1
54-
+int ball2
55-
+int ball3
51+
+array ball_scores
52+
+int bonus_score
53+
+bool strike
54+
+bool spare
55+
+add_ball_score(ball, ball_score)
56+
+get_ball_score(ball)
57+
+update_bonus_score(score)
58+
+bonus_score()
59+
+two_balls?()
60+
+strike(ball)
61+
+strike?()
62+
+spare()
63+
+spare?()
64+
+frame_score()
65+
+total_frame_score()
5666
}
5767
class ScoreCard{
58-
-int game_score
59-
+TotalScore()
68+
+update_pending_bonuses(frames, current_frame)
69+
+show_scorecard(frames)
70+
-update_pending_strikes(frames, current_frame)
71+
-update_pending_spares(frames, current_frame)
72+
-scorecard_segment(frame, frame_number)
73+
-scorecard_segment_frame_10(frame)
74+
}
75+
class Gameplay{
76+
+int current_frame
77+
+int current_ball
78+
+object scorecard
79+
+score_prompt(frames)
80+
+process_current_ball(frame, input)
81+
+next_ball(frames)
82+
+continue?(frames)
83+
+final_score(frames)
84+
-validate_input(input, frames)
6085
}
6186
```
6287

63-
```ruby
64-
class Application
65-
def initialize
66-
@frames = []
67-
@current_frame = 1
68-
@current_frame_ball = 1
69-
create_frames
70-
end
71-
72-
def run
73-
# Runs an IO loop and calls the other classes
74-
end
75-
76-
def create_frames
77-
# Runs once when .run starts to create the `@frames` array of frame objects
78-
end
79-
80-
def return_frames
81-
# Returns the `@frames` array
82-
end
83-
end
84-
85-
class Frame
86-
# A model class with attributes:
87-
# :frame_number, :ball_1, :ball_2, :ball_3
88-
end
89-
90-
class ScoreCard
91-
def GameScore
92-
end
93-
94-
def FrameScore
95-
end
96-
end
97-
```
98-
99-
## 3. Create Examples as Integration Tests
88+
<!-- ## 3. Create Examples as Integration Tests
10089
10190
_Create examples of the classes being used together in different situations and
10291
combinations that reflect the ways in which the system will be used._
@@ -127,4 +116,4 @@ _Encode each example as a test. You can add to the above list as you go._
127116
## 5. Implement the Behaviour
128117
129118
_After each test you write, follow the test-driving process of red, green,
130-
refactor to implement the behaviour._
119+
refactor to implement the behaviour._ -->

0 commit comments

Comments
 (0)