Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5단계 - 자동차 경주(리팩터링) #918

Open
wants to merge 17 commits into
base: relkimm
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
41be7a3
refactor: 패키지를 domain & view 로 분리
relkimm Nov 21, 2022
32edb84
refactor: CarName 글자수 검사 시 require 사용하도록 변경
relkimm Nov 21, 2022
3392656
feat: 기존 자동차를 통해 새로운 자동차 생성하는 로직 추가
relkimm Nov 21, 2022
ffe32fd
refactor: 자동차가 주행하고 나서 새로운 자동차를 반환하도록 수정
relkimm Nov 21, 2022
ccb8ca3
refactor: CarGroup 에서 자동차가 주행하더라도 불변하도록 수정
relkimm Nov 21, 2022
28acace
refactor: Store pub/sub 구조로 변경
relkimm Nov 21, 2022
ee967ec
feat: 라운드 관련 UI 를 표시하는 RoundComponent 추가
relkimm Nov 21, 2022
51ab1c0
refactor: Winner 를 표시하는 UI container/presentational 컴포넌트로 분리
relkimm Nov 21, 2022
b31626d
refactor: Round 를 표시하는 UI container/presentational 컴포넌트로 분리
relkimm Nov 21, 2022
e8b33e2
feat: 자동차 위치를 표시하는 UI container/presentational 컴포넌트 추가
relkimm Nov 21, 2022
81e58af
refactor: 불필요한 RoundResult 정리
relkimm Nov 21, 2022
459562a
refactor: RoundList 와 Round 를 표시하는 UI 분리
relkimm Nov 21, 2022
b4497de
refactor: DistanceComponent 네이밍 변경
relkimm Nov 21, 2022
a0bb3ab
refactor: 프로퍼티에는 this 붙이도록 수정
relkimm Nov 21, 2022
6aed63f
refactor: RoundContainer 에서 라운드 시작하는 로직 render 와 분리
relkimm Nov 21, 2022
3e6350e
feat: 자동차 이름 공백인 경우 유효성 검사 추가
relkimm Nov 21, 2022
133c53c
refactor: store 공통으로 사용할 수 있도록 개선
relkimm Nov 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Round 를 표시하는 UI container/presentational 컴포넌트로 분리
  • Loading branch information
relkimm committed Nov 21, 2022
commit b31626d9722d0c7e8c14e7614ef416ef92087645
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package racingcar.view.component

import racingcar.view.container.RoundContainer
import racingcar.view.container.WinnerContainer
import racingcar.view.store.RoundStore

class RacingResultComponent : Component {
override fun render() {
val rounds = RoundStore.getState()
rounds.forEach { round -> RoundComponent(round = round).render() }
RoundContainer().render()
WinnerContainer().render()
}
}
11 changes: 11 additions & 0 deletions src/main/kotlin/racingcar/view/container/RoundContainer.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package racingcar.view.container

import racingcar.view.component.RoundComponent
import racingcar.view.store.RoundStore

class RoundContainer : Container {
override fun render() {
val rounds = RoundStore.getState()
rounds.forEach { round -> RoundComponent(round = round).render() }
}
}