-
Notifications
You must be signed in to change notification settings - Fork 166
[๐ ์ฌ์ดํด1 - ๋ฏธ์ (๋ณด๋ ์ด๊ธฐํ + ๊ธฐ๋ฌผ ์ด๋)] ์๋ฒ ๋ฏธ์ ์ ์ถํฉ๋๋ค. #265
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
Open
Chocoding1
wants to merge
99
commits into
woowacourse:chocoding1
Choose a base branch
from
Chocoding1:step1
base: chocoding1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
99 commits
Select commit
Hold shift + click to select a range
187d101
docs: ๊ธฐ๋ฅ๋ช
์ธ ์ถ๊ฐ
boyekim c9434e9
feat: Team ์ธํฐํ์ด์ค ์ถ๊ฐ
boyekim b6cb083
feat: Team ์ธํฐํ์ด์ค๋ฅผ ์์๋ฐ๋ ์ด๋๋ผ, ํ๋๋ผ ๋๋ฉ์ธ ์ถ๊ฐ
boyekim 3ea93c4
feat: Board ๋๋ฉ์ธ ์ถ๊ฐ
boyekim 5542ff4
feat: ๊ธฐ๋ฌผ์ ํํํ๋ Piece ์ธํฐํ์ด์ค ์ถ๊ฐ
boyekim e01fb6a
feat: ๋ฐฉํฅ์ ๊ด๋ฆฌํ๋ Delta ๋๋ฉ์ธ ์ถ๊ฐ
boyekim 9dab556
feat: Delta์ ์งํฉ ๋๋ฉ์ธ ์ถ๊ฐ
boyekim 911e4ea
feat: ๊ธฐ๋ฌผ์ ์ ์์ ํ๊ธ ์ด๋ฆ์ ๊ด๋ฆฌํ๋ enum ์ถ๊ฐ
boyekim 6b40cfd
feat: ํ๋๋ผ์ ์ด๋๋ผ๋ฅผ ๋ช
์ํ๋ enum ์ถ๊ฐ
boyekim a969e12
feat: ๊ธฐ๋ฌผ ๋ณ ์ด๋ ํ๋จ ๋ก์ง ๊ตฌํ
boyekim f637cef
feat: ๊ธฐ๋ฌผ ๋ฌถ์ ๋๋ฉ์ธ ์ถ๊ฐ
boyekim 974e9ae
feat: ์์น ๊ฐ์ฒด ์ถ๊ฐ
boyekim 4f8bd85
refactor: score ํ๋ ๊ฐ ์ ๊ฑฐ
boyekim e0bc871
feat: ๊ฒฝ๊ธฐ๋ฅผ ๊ด๋ฆฌํ Turn ๋๋ฉ์ธ ์ถ๊ฐ
boyekim 4d70770
feat: ์์น์ ๋ณด ๋ฐํ ๋ฉ์๋ ์ถ๊ฐ
boyekim 3ea6046
feat: ์ฅ๊ธฐํ ์ด๊ธฐํ ๊ธฐ๋ฅ
boyekim 8bdc49c
feat: ๊ธฐ๋ฌผ ์ขํ ์
๋ ฅ ๋ฐ ๋ฐํ ๊ธฐ๋ฅ ๊ตฌํ
boyekim 02e3cc8
feat: ์ฅ๊ธฐ ์ด๋ ๊ธฐ๋ฅ ์ถ๊ฐ
boyekim af928a6
feat: ์ฅ๊ธฐ ํ์
๋ฐํ ๊ตฌํ๋ถ ์ถ๊ฐ
boyekim c5900f0
refactor: findTeamPiece ํ๋ผ๋ฏธํฐ ์์ ๋ฐ ๋ฉ์๋ ๋ถ๋ฆฌ
Chocoding1 57b9d55
refactor: ํด๋์ค๋ช
Turns -> JanggiGame ๋ณ๊ฒฝ
Chocoding1 9e4a136
refactor: ํด๋์ค๋ช
Turns -> JanggiGame ๋ณ๊ฒฝ
Chocoding1 829e685
refactor: View ๋ฉ์๋ static ๋ฉ์๋๋ก ๋ณ๊ฒฝ
Chocoding1 08a72d1
refactor: ์ด๊ธฐ JanggiGame ์์ฑ ๋ก์ง ์์
Chocoding1 0b38b64
refactor: ๊ธฐ๋ฌผ ์ด๋ ์ ๊ธฐ๋ฌผ ์กฐํ ๋ก์ง ์์
Chocoding1 d0a9671
feat: ํด ๋ช
์ ์ถ๋ ฅ ๊ธฐ๋ฅ ์ถ๊ฐ
boyekim 106c6ad
feat: ํ ํด ์ข
๋ฃ ์ดํ ๋ณด๋ ํํฉ ์ถ๋ ฅ ๊ธฐ๋ฅ ์ถ๊ฐ
boyekim 40bdea8
chore: ์ฃผ์ ์ญ์
boyekim 74fc4e6
refactor: ๋น ์ง ๊ฒ์ฆ๋ถ ์ถ๊ฐ
boyekim 3d674d3
refactor: ์ฌ์ฉํ์ง ์๋ ๋ฉ์๋ ์ญ์ ๋ฐ ๋ชจํธํ ๋ฉ์๋๋ช
๋ณ๊ฒฝ
boyekim 8ac9048
refactor: ๋ถํ์ํ ๋ฉ์๋ ์ญ์
boyekim f718e15
refactor: ๋ถํ์ํ ๋ฉ์๋ ์ญ์
boyekim 068f2af
test: ๊ธฐ๋ฌผ ์ฐจ ํ
์คํธ ์ถ๊ฐ
boyekim 918e074
test: ๊ธฐ๋ฌผ ๊ถ ํ
์คํธ ์ถ๊ฐ
boyekim bc5c056
refactor: JanggiGame ๊ฐ๋ณ์ผ๋ก ๋ณ๊ฒฝ
boyekim 6cd1332
refactor: ์ค๋ณต ๊ฒ์ฆ ์ ๊ฑฐ
boyekim 329e9c2
refactor: ๋ฉ์๋๋ช
๋ณ๊ฒฝ
boyekim 32ff357
refactor: ๋ฉ์๋ ์์ ๋ณ๊ฒฝ
Chocoding1 4f1273b
test: Board ํ
์คํธ ์ถ๊ฐ
boyekim 1dbfe6b
test: Chu ํ
์คํธ ์ถ๊ฐ
boyekim 00832cc
test: Han ํ
์คํธ ์ถ๊ฐ
boyekim 31678c3
test: Jol ํ
์คํธ ์ถ๊ฐ
boyekim 1b40919
test: Ma ํ
์คํธ ์ถ๊ฐ
boyekim 1c6c40c
test: MovePath ํ
์คํธ ์ถ๊ฐ
boyekim c41f608
test: Pieces ํ
์คํธ ์ถ๊ฐ
boyekim 214dbaf
test: Position ํ
์คํธ ์ถ๊ฐ
boyekim 88cef72
test: Po ํ
์คํธ ์ถ๊ฐ
boyekim 64a72f4
test: Sang ํ
์คํธ ์ถ๊ฐ
boyekim 28279e8
test: Sa ํ
์คํธ ์ถ๊ฐ
boyekim a3ff7c5
test: Turn ํ
์คํธ ์ถ๊ฐ
boyekim d03b4bf
refactor: ๋ฉ์๋ ์ปจ๋ฒค์
์ค์
Chocoding1 70ccba4
refactor: ์์ฑ์ ์ ๊ทผ ์ ์ด์ ์์
Chocoding1 7723bfb
refactor: ๋ฉ์๋๋ช
, ๋ณ์๋ช
์์
Chocoding1 3a5c315
refactor: ๋ฏธ์ฌ์ฉ ํ๋ ์ ๊ฑฐ
Chocoding1 0df1517
refactor: ๋ฏธ์ฌ์ฉ ๋ฉ์๋ ์ ๊ฑฐ
Chocoding1 14b6120
refactor: ์ฅ๊ธฐํ ์ถ๋ ฅ ๊ธฐ๋ฅ ์์
boyekim 6f5bc1c
refactor: ExceptionHandler -> ActionExecutor ํด๋์ค๋ช
๋ณ๊ฒฝ
boyekim 5f63b19
refactor: ๊ธฐ๋ฌผ ์ด๋ ์ ์ค๋ณต ๊ฒ์ฆ ๋ก์ง ์ ๊ฑฐ
Chocoding1 bb76c43
docs: readme ์์
Chocoding1 5e1f8c5
refactor: ๋ฏธ์ฌ์ฉ ๋ฉ์๋ ์ ๊ฑฐ
Chocoding1 8c1b511
refactor: Pieces์์ Map์ ๋ฐํํ๋๋ก ํ์ฌ ํ ์ค์ . ํ๋๋ง ์กด์ฌํ๋๋ก ์์
Chocoding1 61e83d6
chore: ๋ฏธ์ฌ์ฉ import๋ฌธ ์ ๊ฑฐ
Chocoding1 0c11a06
refactor: JanggiGame์ JanggiRunner์ ํ๋๋ก ๋ณ๊ฒฝ
Chocoding1 7ab7e22
refactor: ๊ธฐ๋ฌผ ์กฐํ ๊ธฐ๋ฅ์ ์ ํฉํ ๋ฉ์๋ ์ถ๊ฐ
Chocoding1 7ddf820
refactor: ํ ์ค์ . ํ๋๋ง ์กด์ฌํ๋๋ก ํ๊ธฐ ์ํด ๊ธฐ๋ฌผ ์ด๋ฆ ๋ฐํํ๋ ๋ฉ์๋ ์ถ๊ฐ
Chocoding1 c24802b
๊ธฐ๋ฌผ๋ณ ์ด๋ ๊ท์น ๋ก์ง ์์
Chocoding1 4b66bfa
refactor: ํธ์ถ ๋ฉ์๋ ๋ณ๊ฒฝ
Chocoding1 8b6c273
refactor: ๋ฏธ์ฌ์ฉ ๋ฉ์๋ ์ ๊ฑฐ
Chocoding1 0a2f89b
chore: ๋ณ์๋ช
, ๋ฉ์๋๋ช
์์
Chocoding1 dbb4aae
chore: ์๋ฌ ๋ฉ์์ง ์์
Chocoding1 ae37c36
chore: ๋ฉ์๋๋ช
์์
Chocoding1 0026eb7
refactor: ๋ฏธ์ฌ์ฉ ๋ฉ์๋ ์ ๊ฑฐ
Chocoding1 4590338
refactor: ์ค๋ณต ๋ก์ง ๋ฉ์๋ ์ถ์ถ
Chocoding1 544c68f
refactor: ๋ฉ์๋ ์์ ๋ณ๊ฒฝ
Chocoding1 baa91d4
refactor: Piece ์ธํฐํ์ด์ค์์ ๋ถํ์ ๋ฉ์๋ ์ ๊ฑฐ ๋ฐ ํ
์คํธ ์ฝ๋ ์์
Chocoding1 1c198af
refactor: ๋ถํ์ ํ
์คํธ ์ฝ๋ ์ ๊ฑฐ ๋ฐ ํ
์คํธ ์ฝ๋ ์์
Chocoding1 aa9d572
refactor: BoardSpot์์ Position ํ๋ ์ ๊ฑฐ
Chocoding1 e3d00ea
refactor: ๋์ผ ์์น ๊ฒ์ฆ ๋ก์ง Position ๊ฐ์ฒด๋ก ์ด์
Chocoding1 8f0f014
refactor: ํ ์นธ๋ง ๊ฐ๋์ง ํ์ธํ๋ ๋ฉ์๋ Position ๊ฐ์ฒด๋ก ์ด์
Chocoding1 95a3b05
refactor: ์ง์ ์ด๋ ์ฒดํฌ ๋ก์ง Position ๊ฐ์ฒด๋ก ์ด๋
Chocoding1 604b712
refactor: delta ๊ณ์ฐ ๋ก์ง Position ๊ฐ์ฒด ๋ด๋ถ๋ก ์ด๋
Chocoding1 53f1b21
refactor: Delta๋ ๋ฐ๋์ง ์๊ธฐ ๋๋ฌธ์ enum ํด๋์ค๋ก ๋ณ๊ฒฝ
Chocoding1 d4aa367
refactor: MovePath๊ฐ์ฒด ๋งค๋ฒ ์์ฑํ์ง ์๋๋ก ์์ ๋ณ์๋ก ์์
Chocoding1 31c58d9
refactor: Piece interface๋ฅผ ์ถ์ ํด๋์ค๋ก ๋ณ๊ฒฝํ์ฌ ์ค๋ณต ๋ฉ์๋ ๋ฐ ์ค๋ณต ํ๋ ์ ๊ฑฐ
Chocoding1 dfac78c
refactor: ๋ฉ์๋ ์์ ๋ณ๊ฒฝ
Chocoding1 6fbbd6e
refactor: ์๋ฌ ๋ฉ์์ง ์์
Chocoding1 871c469
chore: ๋ฉ์๋๋ช
์์
Chocoding1 3ee750c
refactor: ๊ธฐ๋ฌผ ์ด๋ ๊ฐ๋ฅ ์ฌ๋ถ ๊ฒ์ฆ ๋ก์ง ์์
Chocoding1 5f067b4
refactor: ์ค๋ณต ๋ฉ์๋ ์ถ์ ํด๋์ค๋ก ์ด๋
Chocoding1 26e1f8b
chore: ๋น ์ค ์ ๊ฑฐ
Chocoding1 079cf1e
refactor: ๋ฏธ์ฌ์ฉ ๋ฉ์๋ ์ ๊ฑฐ
Chocoding1 b0619a0
refactor: ์ค๋ณต ์ฝ๋ ์ ๊ฑฐ๋ฅผ ์ํด ์์ธ ๋ฐ์ ์์น ๋ณ๊ฒฝ
Chocoding1 bceaae4
refactor: Pieces ํด๋์ค ์ ๊ฑฐ & Team ์ธํฐํ์ด์ค ์ถ์ ํด๋์ค๋ก ๋ณ๊ฒฝ
Chocoding1 9c14ad8
refactor: getter์ ๋ฐฉ์ด์ ๋ณต์ฌ ์ ์ฉ
Chocoding1 5ab4d46
refactor: DTO ๋ด๋ถ์ ํฉํ ๋ฆฌ ๋ฉ์๋๋ฅผ ์ถ๊ฐํด ๋๋ฉ์ธ์์ DTO ๋ด๋ถ ๊ตฌ์กฐ๋ฅผ ๋ชจ๋ฅด๋๋ก ์์
Chocoding1 ad0ab80
chore: ๋ฉ์๋ ์์ ๋ณ๊ฒฝ
Chocoding1 1270f39
refactor: ๋ก์ง ๋ฉ์๋ ์ถ์ถ
Chocoding1 ba02709
refactor: ์ถ์ ํด๋์ค๋ฅผ ์์ฑํ์ฌ ์ค๋ณต ๋ก์ง ์ ๊ฑฐ
Chocoding1 2ffdaf4
refactor: Piece์ Board ๊ฐ์ ์ํ ์ฐธ์กฐ ์ ๊ฑฐ
Chocoding1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,62 @@ | ||
| # java-janggi | ||
|
|
||
| ์ฅ๊ธฐ ๋ฏธ์ ์ ์ฅ์ | ||
| ## ํ๋ก๊ทธ๋จ ํ๋ฆ | ||
| 1. **[์ถ๋ ฅ] ์ฅ๊ธฐ ๊ฒ์ ์์ ๋ฌธ๊ตฌ๋ฅผ ์ถ๋ ฅํ๋ค.** | ||
| 2. **[์ค๊ฐ ๊ณผ์ ] ์ฅ๊ธฐํ์ ์ด๊ธฐํํ๋ค.** | ||
| 3. **[์ถ๋ ฅ] ์ด๊ธฐํ๋ ์ฅ๊ธฐํ์ ์ถ๋ ฅํ๋ค.** | ||
| 4. **[์ ๋ ฅ] ์์ง์ผ ๊ธฐ๋ฌผ ์ขํ๋ฅผ ์ ๋ ฅ๋ฐ๋๋ค.** | ||
|
|
||
| [์์ธ์ฒ๋ฆฌ] ์ขํ๋ฅผ ์ผํ๋ก ๊ตฌ๋ถํ์ง ์์์ ๊ฒฝ์ฐ IllegalArgmentException ์์ธ๋ฅผ ๋ฐ์์ํจ๋ค. | ||
|
|
||
| [์์ธ์ฒ๋ฆฌ] ์ขํ๋ฅผ ์ซ์๋ก ์ ๋ ฅํ์ง ์์์ ๊ฒฝ์ฐ IllegalArgmentException ์์ธ๋ฅผ ๋ฐ์์ํจ๋ค. | ||
|
|
||
| [์์ธ์ฒ๋ฆฌ] ์ฅ๊ธฐํ ๋ฒ์ ๋ฐ์ ์ขํ๋ฅผ ์ ๋ ฅํ์ ๊ฒฝ์ฐ IllegalArgmentException ์์ธ๋ฅผ ๋ฐ์์ํจ๋ค. | ||
|
|
||
| [์์ธ์ฒ๋ฆฌ] ์ ๋ ฅํ ์ขํ์ ๊ธฐ๋ฌผ์ด ์์ ๊ฒฝ์ฐ IllegalArgmentException ์์ธ๋ฅผ ๋ฐ์์ํจ๋ค. | ||
| 5. **[์ ๋ ฅ] ๋ชฉ์ ์ง ์ขํ๋ฅผ ์ ๋ ฅ๋ฐ๋๋ค.** | ||
|
|
||
| [์์ธ์ฒ๋ฆฌ] ์ขํ๋ฅผ ์ผํ๋ก ๊ตฌ๋ถํ์ง ์์์ ๊ฒฝ์ฐ IllegalArgmentException ์์ธ๋ฅผ ๋ฐ์์ํจ๋ค. | ||
|
|
||
| [์์ธ์ฒ๋ฆฌ] ์ขํ๋ฅผ ์ซ์๋ก ์ ๋ ฅํ์ง ์์์ ๊ฒฝ์ฐ IllegalArgmentException ์์ธ๋ฅผ ๋ฐ์์ํจ๋ค. | ||
|
|
||
| [์์ธ์ฒ๋ฆฌ] ์ฅ๊ธฐํ ๋ฒ์ ๋ฐ์ ์ขํ๋ฅผ ์ ๋ ฅํ์ ๊ฒฝ์ฐ IllegalArgmentException ์์ธ๋ฅผ ๋ฐ์์ํจ๋ค. | ||
|
|
||
| [์์ธ์ฒ๋ฆฌ] ์ ๋ ฅํ ์ขํ ๋๋ ์ด๋ ๊ฒฝ๋ก์ ์๊ตฐ ๊ธฐ๋ฌผ์ด ์กด์ฌํ ๊ฒฝ์ฐ IllegalArgmentException ์์ธ๋ฅผ ๋ฐ์์ํจ๋ค. | ||
| 6. **[์ค๊ฐ ๊ณผ์ ] ๊ธฐ๋ฌผ์ ์ด๋์ํจ๋ค.** | ||
| 7. **[์ถ๋ ฅ] ๊ฐฑ์ ๋ ์ฅ๊ธฐํ์ ์ถ๋ ฅํ๋ค.** | ||
|
|
||
| ## ์ถ๋ ฅ์์ | ||
| ``` | ||
| ์ฅ๊ธฐ ๊ฒ์์ ์์ํฉ๋๋ค. | ||
|
|
||
| ใใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ๏ผ๏ผใ์ฐจใ๋งใ์ใ์ฌใ๏ผใ์ฌใ์ใ๋งใ์ฐจใ | ||
| ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๊ถใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ใ๏ผใ๏ผใํฌใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใํฌใ๏ผใ | ||
| ใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ | ||
| ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ | ||
| ใ๏ผใ๏ผใํฌใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใํฌใ๏ผใ | ||
| ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๊ถใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ใ๏ผใ์ฐจใ๋งใ์ใ์ฌใ๏ผใ์ฌใ์ใ๋งใ์ฐจใ | ||
| ์ด๋๋ผ์ ์ฐจ๋ก์ ๋๋ค. | ||
| ์์ง์ผ ๊ธฐ๋ฌผ์ ์ขํ๋ฅผ ์ ๋ ฅํด์ฃผ์ธ์. (ex. 1,3) | ||
| 1,1 | ||
| ์ฐจ์ ๋ชฉ์ ์ขํ๋ฅผ ์ ๋ ฅํด์ฃผ์ธ์. (ex. 1,3) | ||
| 1,3 | ||
| ใใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ๏ผ๏ผใ์ฐจใ๋งใ์ใ์ฌใ๏ผใ์ฌใ์ใ๋งใ์ฐจใ | ||
| ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๊ถใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ใ๏ผใ๏ผใํฌใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใํฌใ๏ผใ | ||
| ใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ | ||
| ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ๏ผใ์กธใ | ||
| ใ๏ผใ์ฐจใํฌใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใํฌใ๏ผใ | ||
| ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๊ถใ๏ผใ๏ผใ๏ผใ๏ผใ | ||
| ใ๏ผใ๏ผใ๋งใ์ใ์ฌใ๏ผใ์ฌใ์ใ๋งใ์ฐจใ | ||
| ํ๋๋ผ์ ์ฐจ๋ก์ ๋๋ค. | ||
| ์์ง์ผ ๊ธฐ๋ฌผ์ ์ขํ๋ฅผ ์ ๋ ฅํด์ฃผ์ธ์. (ex. 1,3) | ||
|
|
||
| ``` |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package janggi; | ||
|
|
||
| public class Application { | ||
|
|
||
| public static void main(String[] args) { | ||
| JanggiRunner janggiRunner = new JanggiRunner(); | ||
| janggiRunner.execute(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package janggi; | ||
|
|
||
| import janggi.domain.JanggiGame; | ||
| import janggi.domain.Position; | ||
| import janggi.util.DelimiterParser; | ||
| import janggi.util.ActionExecutor; | ||
| import janggi.view.InputView; | ||
| import janggi.view.OutputView; | ||
| import java.util.List; | ||
|
|
||
| public class JanggiRunner { | ||
|
|
||
| private final JanggiGame janggiGame; | ||
|
|
||
| public JanggiRunner() { | ||
| this.janggiGame = JanggiGame.createInitialJanggiGame(); | ||
| } | ||
|
|
||
| public void execute() { | ||
| OutputView.printStartMessage(); | ||
|
|
||
| while (true) { | ||
| OutputView.printBoard(janggiGame.makeCurrentTurnBoardSnapShot()); | ||
| Position startPosition = ActionExecutor.retryUntilSuccess(this::readValidStartPosition); | ||
| Position endPosition = ActionExecutor.retryUntilSuccess(() -> readValidEndPosition(startPosition)); | ||
| janggiGame.doGame(startPosition, endPosition); | ||
| } | ||
| } | ||
|
|
||
| private Position readValidStartPosition() { | ||
| OutputView.printTurnNotice(janggiGame.getCurrentTurnTeamName()); | ||
| OutputView.printAskPiecePosition(); | ||
| Position startPosition = createPosition(); | ||
| janggiGame.validatePieceExists(startPosition); | ||
| return startPosition; | ||
| } | ||
|
|
||
| private Position readValidEndPosition(Position startPosition) { | ||
| OutputView.printAskMovePosition(janggiGame.getPieceName(startPosition)); | ||
| Position endPosition = createPosition(); | ||
| janggiGame.validateValidEndPosition(startPosition, endPosition); | ||
| return endPosition; | ||
| } | ||
|
|
||
| private static Position createPosition() { | ||
| String rawPiecePosition = InputView.readLine(); | ||
| List<String> parsedPiecePosition = DelimiterParser.parse(rawPiecePosition); | ||
| return Position.makePosition(parsedPiecePosition); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| package janggi.domain; | ||
|
|
||
| import janggi.domain.piece.Piece; | ||
| import janggi.domain.side.Chu; | ||
| import janggi.domain.side.Han; | ||
| import janggi.domain.side.Team; | ||
| import janggi.domain.side.TeamType; | ||
| import janggi.dto.BoardSpots; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Optional; | ||
|
|
||
| public class Board { | ||
|
|
||
| private static final int FIRST_INDEX = 1; | ||
| private static final int LAST_X_INDEX = 9; | ||
| private static final int LAST_Y_INDEX = 10; | ||
|
|
||
| private final Team chu; | ||
| private final Team han; | ||
|
|
||
| private Board(Team chu, Team han) { | ||
| this.chu = chu; | ||
| this.han = han; | ||
| } | ||
|
|
||
| public static Board createInitialBoard() { | ||
| return new Board(Chu.createInitialChu(), Han.createInitialHan()); | ||
| } | ||
|
|
||
| public BoardSpots makeSnapShot() { | ||
| Map<Position, Piece> allPieces = new HashMap<>(chu.getPieces()); | ||
| allPieces.putAll(han.getPieces()); | ||
| return BoardSpots.from(allPieces); | ||
| } | ||
|
|
||
| public boolean isPieceExists(Position position, TeamType currentTeamType) { | ||
| validateRange(position); | ||
| Team currentTeam = currentTeam(currentTeamType); | ||
| return currentTeam.isPieceExists(position); | ||
| } | ||
|
|
||
| public String getPieceName(Position position, TeamType currentTeamType) { | ||
| Piece piece = findTeamPiece(position, currentTeam(currentTeamType)); | ||
| return piece.name(); | ||
| } | ||
|
|
||
| public void validateCanMove(Position start, Position end, TeamType currentTeamType) { | ||
| validateRange(end); | ||
| checkSamePosition(start, end); | ||
| validateTeamPieceExistsAtEnd(currentTeam(currentTeamType), end); | ||
| validatePiecesInPath(start, end, currentTeam(currentTeamType)); | ||
| } | ||
|
|
||
| public Optional<Piece> findPiece(Position position) { | ||
| Optional<Piece> chuPiece = chu.findPiece(position); | ||
| if (chuPiece.isPresent()) { | ||
| return chuPiece; | ||
| } | ||
| return han.findPiece(position); | ||
| } | ||
|
|
||
| public Board move(Position start, Position end, TeamType currentTeamType) { | ||
| Team updatedCurrentTeam = currentTeam(currentTeamType).move(start, end); | ||
| Team updatedOpponentTeam = removeOpponentPiece(currentTeamType, end); | ||
| return createMovedBoard(currentTeamType, updatedCurrentTeam, updatedOpponentTeam); | ||
| } | ||
|
|
||
| private void validateRange(Position inputPosition) { | ||
| int x = inputPosition.getX(); | ||
| int y = inputPosition.getY(); | ||
| if (isNotInRange(FIRST_INDEX, LAST_X_INDEX, x) || isNotInRange(FIRST_INDEX, LAST_Y_INDEX, y)) { | ||
| throw new IllegalArgumentException("์ ๋ ฅํ ์ขํ๊ฐ ์ฅ๊ธฐํ ๋ฒ์ ๋ฐ์ ๋๋ค."); | ||
| } | ||
| } | ||
|
|
||
| private boolean isNotInRange(int start, int last, int index) { | ||
| return !isInRange(start, last, index); | ||
| } | ||
|
|
||
| private boolean isInRange(int start, int last, int index) { | ||
| return index >= start && index <= last; | ||
| } | ||
|
|
||
| private void checkSamePosition(Position start, Position end) { | ||
| if (start.isSamePosition(end)) { | ||
| throw new IllegalArgumentException("์ถ๋ฐ์ง์ ๋ชฉ์ ์ง๊ฐ ๋์ผํฉ๋๋ค."); | ||
| } | ||
| } | ||
|
|
||
| private void validateTeamPieceExistsAtEnd(Team team, Position end) { | ||
| if (team.isPieceExists(end)) { | ||
| throw new IllegalArgumentException("์๊ตฐ์ด ์กด์ฌํ๋ ์ขํ๋ก๋ ์ด๋ํ ์ ์์ต๋๋ค."); | ||
| } | ||
| } | ||
|
|
||
| private Team currentTeam(TeamType currentTeamType) { | ||
| if (currentTeamType == TeamType.CHU) { | ||
| return chu; | ||
| } | ||
| return han; | ||
| } | ||
|
|
||
| private void validatePiecesInPath(Position start, Position end, Team currentTeam) { | ||
| Piece piece = findTeamPiece(start, currentTeam); | ||
| List<Position> piecePositionsInPath = piece.getPiecePositionsInPath(start, end); | ||
| List<Piece> piecesInPath = piecePositionsInPath.stream() | ||
| .map(this::findPiece) | ||
| .filter(Optional::isPresent) | ||
| .map(Optional::get) | ||
| .toList(); | ||
| piece.validateCanMove(piecesInPath); | ||
| } | ||
|
|
||
| private Piece findTeamPiece(Position position, Team currentTeam) { | ||
| return currentTeam.findPiece(position) | ||
| .orElseThrow(() -> new IllegalArgumentException("์ ๋ ฅํ ์์น์ ๊ธฐ๋ฌผ์ด ์์ต๋๋ค.")); | ||
| } | ||
|
|
||
| private Team removeOpponentPiece(TeamType currentTeamType, Position end) { | ||
| Team opponentTeam = opponentTeam(currentTeamType); | ||
| if (opponentTeam.findPiece(end).isEmpty()) { | ||
| return opponentTeam; | ||
| } | ||
| return opponentTeam.remove(end); | ||
| } | ||
|
|
||
| private Team opponentTeam(TeamType currentTeamType) { | ||
| if (currentTeamType == TeamType.CHU) { | ||
| return han; | ||
| } | ||
| return chu; | ||
| } | ||
|
|
||
| private Board createMovedBoard(TeamType currentTeamType, Team updatedCurrentTeam, Team updatedOpponentTeam) { | ||
| if (currentTeamType == TeamType.CHU) { | ||
| return new Board(updatedCurrentTeam, updatedOpponentTeam); | ||
| } | ||
| return new Board(updatedOpponentTeam, updatedCurrentTeam); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package janggi.domain; | ||
|
|
||
| public enum Delta { | ||
|
|
||
| UP(0, 1), | ||
| DOWN(0, -1), | ||
| RIGHT(1, 0), | ||
| LEFT(-1, 0), | ||
| RIGHT_UP(1, 1), | ||
| LEFT_UP(-1, 1), | ||
| RIGHT_DOWN(1, -1), | ||
| LEFT_DOWN(-1, -1), | ||
| ; | ||
|
|
||
| private final int dx; | ||
| private final int dy; | ||
|
|
||
| Delta(int dx, int dy) { | ||
| this.dx = dx; | ||
| this.dy = dy; | ||
| } | ||
|
|
||
| public int getDx() { | ||
| return dx; | ||
| } | ||
|
|
||
| public int getDy() { | ||
| return dy; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| package janggi.domain; | ||
|
|
||
| import janggi.dto.BoardSpots; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| public class JanggiGame { | ||
|
|
||
| private final List<Turn> turns; | ||
|
|
||
| private JanggiGame(List<Turn> turns) { | ||
| this.turns = new ArrayList<>(turns); | ||
| } | ||
|
|
||
| public static JanggiGame createInitialJanggiGame() { | ||
| return new JanggiGame(List.of(Turn.createInitialTurn())); | ||
| } | ||
|
|
||
| public BoardSpots makeCurrentTurnBoardSnapShot() { | ||
| Turn lastTurn = getLastTurn(); | ||
| return lastTurn.makeBoardSnapShot(); | ||
| } | ||
|
|
||
| public String getCurrentTurnTeamName() { | ||
| Turn lastTurn = getLastTurn(); | ||
| return lastTurn.nextTurnTeam(); | ||
| } | ||
|
|
||
| public void validatePieceExists(Position position) { | ||
| Turn lastTurn = getLastTurn(); | ||
| if (!lastTurn.isNextTurnTeamPieceExists(position)) { | ||
| throw new IllegalArgumentException("๊ธฐ๋ฌผ์ด ์กด์ฌํ๋ ์ขํ๊ฐ ์๋๋๋ค."); | ||
| } | ||
| } | ||
|
|
||
| public String getPieceName(Position position) { | ||
| return getLastTurn().getPieceName(position); | ||
| } | ||
|
|
||
| public void validateValidEndPosition(Position start, Position end) { | ||
| Turn lastTurn = getLastTurn(); | ||
| lastTurn.validateCanMove(start, end); | ||
| } | ||
|
|
||
| public void doGame(Position start, Position end) { | ||
| Turn lastTurn = getLastTurn(); | ||
| Turn newTurn = lastTurn.move(start, end); | ||
| turns.add(newTurn); | ||
| } | ||
|
|
||
| private Turn getLastTurn() { | ||
| return turns.getLast(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Board๋ฅผ ๋ถ๋ณ๊ฐ์ฒด๋ก ๋ง๋ค๋ฉด ์ด๋ค ์ฅ์ ์ด ์๋์??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ List์ ํตํด ๊ธฐ๋ณด๋ฅผ ๊ธฐ๋กํ๋๋ก ์ค๊ณ๋ฅผ ํ๊ณ , ๊ฐ Turn ์์๋ ํด๋ง๋ค์ Board ์ํ๊ฐ ํ๋๋ก ์กด์ฌํฉ๋๋ค.
์ด Board๋ฅผ ๋ถ๋ณ ๊ฐ์ฒด๋ก ๋ง๋ค๋ฉด ๋ค๋ฅธ Turn์์์ Board ๋ณ๊ฒฝ์ด ์ด์ Turn์ Board์ ์ํฅ์ ์ฃผ์ง ์๊ฒ ๋๊ณ , ์ด๋ก ์ธํด ๊ฐ ํด์์์ Board ์ํ๋ฅผ ์จ์ ํ ๋ณด์กดํ ์ ์์ต๋๋ค!