Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
009de5d
refactor(OutputView): ์ถœ๋ ฅ ๋กœ์ง ๋ถ„๋ฆฌ
juntae6942 Mar 28, 2026
53df5a9
chore(Point): ํŒจํ‚ค์ง€ ์ด๋™
juntae6942 Mar 28, 2026
ce78b3b
refactor(Route): Point ๋ฆฌ์ŠคํŠธ ์—ญํ• ๋ถ€์—ฌ
juntae6942 Mar 28, 2026
1aa202e
refactor(Route): Points์™€ Route ์ฑ…์ž„ ๋ถ„๋ฆฌ
juntae6942 Mar 28, 2026
5a5da77
test(Route): Points์™€ Route ์ฑ…์ž„ ๋ถ„๋ฆฌ์— ๋”ฐ๋ฅธ ์ˆ˜์ •
juntae6942 Mar 28, 2026
aa9a62f
refactor(Route): Points์™€ Route ์ •์˜
juntae6942 Mar 28, 2026
0f1da61
refactor(PositionInfo): col, row ํ†ต์ผ
juntae6942 Mar 28, 2026
fd63ca3
fix(Route): boolean ๋ฐ˜ํ™˜๊ฐ’ ์ˆ˜์ •
juntae6942 Mar 28, 2026
4f41b55
refactor(Board): ๋ณ€์ˆ˜๋ช… ์ˆ˜์ •
juntae6942 Mar 28, 2026
506a318
refactor(Route): ๋งค์ง ๋„˜๋ฒ„ ์ œ๊ฑฐ
juntae6942 Mar 28, 2026
2ee2313
refactor(Piece): ์ˆ˜ํ•™์  ๊ณ„์‚ฐ ๋กœ์ง์„ ๋ฐฉํ–ฅ์„ ์‚ฌ์šฉํ•œ ๋กœ์ง์œผ๋กœ ์ˆ˜์ •
juntae6942 Mar 28, 2026
ee3d02f
refactor(Piece): col,row ํ†ต์ผ
juntae6942 Mar 28, 2026
1d3c1bf
test(Cha): ๊ถ์„ฑ ์•ˆ์—์„œ ์›€์ง์ž„ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ
juntae6942 Mar 30, 2026
c128726
feat(Cha): ๊ถ์„ฑ ์•ˆ์—์„œ ์›€์ง์ž„ ๊ตฌํ˜„
juntae6942 Mar 30, 2026
f9952c7
test(Pho): ๊ถ์„ฑ ์•ˆ์—์„œ ์›€์ง์ž„ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ
juntae6942 Mar 30, 2026
6f79f85
refactor(Pho): ๊ถ์„ฑ ์•ˆ์—์„œ ์›€์ง์ž„ ๊ตฌํ˜„
juntae6942 Mar 30, 2026
db7292e
test(Board): ๊ถ์„ฑ ์•ˆ์—์„œ ์›€์ง์ž„ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ
juntae6942 Mar 30, 2026
8fc3f25
feat: ๊ถ์„ฑ ์•ˆ์—์„œ ์›€์ง์ž„ ๊ตฌํ˜„์„ ์œ„ํ•œ ๋ฐฉํ–ฅ ๋งต ๊ตฌํ˜„
juntae6942 Mar 30, 2026
5c2096f
test(jang&sa): ๊ถ์„ฑ ๋ฐ–์œผ๋กœ ๋ชป๋‚˜๊ฐ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ
juntae6942 Mar 30, 2026
e36b69f
feat(jang&sa): ๊ถ์„ฑ ๋ฐ–์œผ๋กœ ๋ชป๋‚˜๊ฐ ๊ฒ€์ฆ ๊ตฌํ˜„
juntae6942 Mar 30, 2026
b200d50
test(jol): ๊ถ์„ฑ์—์„œ ํ•œ๋‚˜๋ผ ์กธ์€ ์œ„๋กœ ๋ชป๊ฐ€๋Š” ๊ฒ€์ฆ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ
juntae6942 Mar 30, 2026
4cddc93
feat(jol): ๊ถ์„ฑ์—์„œ ๋Œ€๊ฐ์„  ์ด๋™ ๊ธฐ๋Šฅ ๊ตฌํ˜„
juntae6942 Mar 30, 2026
ac47705
refactor(jang&sa): ๋Œ€๊ฐ์„  ๋ฐฉํ–ฅ ์ œํ•œ ์ˆ˜์ •
juntae6942 Mar 30, 2026
27b3b6e
refactor(Cha&Pho): ๋Œ€๊ฐ์„  ๋ฐฉํ–ฅ ์ œํ•œ ์ฝ”๋“œ ์ˆ˜์ •
juntae6942 Mar 30, 2026
3b1797b
refactor(Point): ๋งค์ง๋„˜๋ฒ„ ์ œ๊ฑฐ
juntae6942 Mar 30, 2026
1dccc84
refactor(Piece): ๊ฒ€์ฆ ๋ถ„๋ฆฌ
juntae6942 Mar 30, 2026
2d06433
chore(Database): h2, jdbc ์˜์กด์„ฑ ์ถ”๊ฐ€
juntae6942 Mar 31, 2026
80ea3f1
chore(Board): ํŒจํ‚ค์ง• ์ด๋™
juntae6942 Mar 31, 2026
331725b
chore(Board): ํŒจํ‚ค์ง• ์ด๋™
juntae6942 Mar 31, 2026
15aed38
style(Cha): ๊ฐœํ–‰ ์ œ๊ฑฐ
juntae6942 Mar 31, 2026
0b13397
test(Board): ๊ฐœํ–‰ ์ œ๊ฑฐ
juntae6942 Mar 31, 2026
3856888
test(Board): ๋‚˜๋ผ๋ณ„ ์ ์ˆ˜ ๊ณ„์‚ฐ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ
juntae6942 Mar 31, 2026
45b8fee
feat(Board): ๋‚˜๋ผ๋ณ„ ์ ์ˆ˜ ๊ณ„์‚ฐ ๊ธฐ๋Šฅ ๊ตฌํ˜„
juntae6942 Mar 31, 2026
acaf869
feat(Board): ๋‚˜๋ผ๋ณ„ ์ ์ˆ˜ ๊ณ„์‚ฐ ๊ธฐ๋Šฅ ๊ตฌํ˜„
juntae6942 Mar 31, 2026
96e2d3b
chore(Point): ํŒจํ‚ค์ง• ์ˆ˜์ •
juntae6942 Mar 31, 2026
910b99c
feat(JanggiRepository): ์žฅ๊ธฐ ๋ฐ์ดํ„ฐ ์ €์žฅ์„ ์œ„ํ•œ DB ๊ตฌํ˜„
juntae6942 Mar 31, 2026
ae7a073
feat(JanggiGameService): repository์™€ domain ๊ฐ„์˜ ๋ฐ์ดํ„ฐ ์ €์žฅ์„ ์œ„ํ•œ service๋‹จ ๊ตฌํ˜„
juntae6942 Mar 31, 2026
0912c36
feat(JanggiGameController): Service๋‹จ๊ณผ View๋‹จ ๊ฐ„์˜ ํ˜‘๋ ฅ์„ ์œ„ํ•œ Controller ๊ตฌํ˜„
juntae6942 Mar 31, 2026
fcfd62a
feat(Application): ์˜์กด์„ฑ ์ฃผ์ž…
juntae6942 Mar 31, 2026
5e2e0d9
feat(InputView): ๊ฒŒ์ž„ ์‹œ์ž‘ ๋ฐ ๊ฒŒ์ž„๋ฐฉ ์„ ํƒ ์ž…๋ ฅ ๊ตฌํ˜„
juntae6942 Mar 31, 2026
a6b33cf
feat(OutputView): ์ ์ˆ˜ ๋ฐ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ ๊ธฐ๋Šฅ ๊ตฌํ˜„
juntae6942 Mar 31, 2026
a3974b3
docs(readme): ์š”๊ตฌ์‚ฌํ•ญ ์ˆ˜์ •
juntae6942 Mar 31, 2026
4432a08
refactor(AbstractPiece): ๋‹ค์ค‘ ์ƒ์† ์š”์†Œ๊ฐ€ ์—†์–ด, ์ถ”์ƒ ๊ณจ๊ฒฉ ํด๋ž˜์Šค ์‚ญ์ œ
juntae6942 Mar 31, 2026
4878c6d
docs(readme): ์š”๊ตฌ์‚ฌํ•ญ ์ˆ˜์ •
juntae6942 Apr 1, 2026
1dc2d87
docs(readme): DDL ์ถ”๊ฐ€
juntae6942 Apr 1, 2026
9cbd761
refactor(Piece): ์ถ”์ƒ ๊ณจ๊ฒฉ ํด๋ž˜์Šค ๋ถ„๋ฅ˜
juntae6942 Apr 1, 2026
3e8cc8e
refactor(Piece): ์ถ”์ƒ ๊ณจ๊ฒฉ ํด๋ž˜์Šค ๋ถ„๋ฅ˜
juntae6942 Apr 1, 2026
29cce32
refactor(AbstractStraightPiece): ์ถ”์ƒ ๊ณจ๊ฒฉ ํด๋ž˜์Šค ๋ถ„๋ฅ˜์— ๋”ฐ๋ฅธ ๊ณตํ†ต ์ฝ”๋“œ ์ œ๊ฑฐ
juntae6942 Apr 1, 2026
cdb2bd0
refactor(AbstractPiece): ์ถ”์ƒ ๊ณจ๊ฒฉ ํด๋ž˜์Šค ๋ถ„๋ฅ˜์— ๋”ฐ๋ฅธ ๊ณตํ†ต ์ฝ”๋“œ ์ œ๊ฑฐ
juntae6942 Apr 1, 2026
4bddfbb
refactor(AbstractNormalPiece): ์ถ”์ƒ ๊ณจ๊ฒฉ ํด๋ž˜์Šค ๋ถ„๋ฅ˜์— ๋”ฐ๋ฅธ ๊ณตํ†ต ์ฝ”๋“œ ์ œ๊ฑฐ
juntae6942 Apr 1, 2026
aca2eac
test(Ma): ๋ถˆํ•„์š”ํ•œ import ์ œ๊ฑฐ
juntae6942 Apr 1, 2026
c1217e1
test(AbstractNormalPiece): ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€ ํ†ต์ผ
juntae6942 Apr 1, 2026
c4adcf9
refactor(Jol): ์ถ”์ƒ ๋ถ„๋ฆฌ
juntae6942 Apr 1, 2026
40f5065
refactor(AbstractFixedStepPiece): ํด๋ž˜์Šค๋ช… ๋ณ€๊ฒฝ
juntae6942 Apr 1, 2026
30d33bd
feat(init): DDL ์„ค์ • ํŒŒ์ผ ์ถ”๊ฐ€
juntae6942 Apr 1, 2026
122afad
refactor(init): DDL ์„ค์ • ์ œ๊ฑฐ
juntae6942 Apr 1, 2026
10f1024
chore(Piece): ํŒจํ‚ค์ง• ์ˆ˜์ •
juntae6942 Apr 1, 2026
bc289da
chore(util): ํŒจํ‚ค์ง€ ์ด๋™
juntae6942 Apr 2, 2026
eb438b0
refactor(Pho): ์žฅ์• ๋ฌผ ์—†๋Š” ๊ฒฝ์šฐ ์ˆ˜์ •
juntae6942 Apr 2, 2026
e436cf8
refactor(AbstractStraightPiece): ์ถ”์ƒ ํด๋ž˜์Šค ์ง€์ • ๋ฐ ์ถ”์ƒ ๋ฉ”์„œ๋“œ ์ง€์ •
juntae6942 Apr 2, 2026
ad666f3
feat(application.properties): DB ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋“ฑ๋ก
juntae6942 Apr 2, 2026
ebb4d6e
refactor(SangDirection): ์ธ์Šคํ„ด์Šค ๋ณ€์ˆ˜ ์ค„์ด๊ธฐ
juntae6942 Apr 2, 2026
7b33741
refactor(MaDirection): ์ธ์Šคํ„ด์Šค ๋ณ€์ˆ˜ ์ค„์ด๊ธฐ
juntae6942 Apr 2, 2026
8f147b5
refactor(GameCommand): y,n ๋ช…๋ น์–ด ์—ญํ•  ๋ถ€์—ฌ
juntae6942 Apr 2, 2026
12bf254
style(JdbcBoardRepository): ์ปจ๋ฒค์…˜ ์ˆ˜์ •
juntae6942 Apr 2, 2026
92f051a
refactor(View): View ๊ฐ์ฒด๋กœ ๋ณ€๊ฒฝ
juntae6942 Apr 2, 2026
73ba061
refactor(Board): board ์ดˆ๊ธฐํ™” ์ˆ˜์ •
juntae6942 Apr 2, 2026
8359400
refactor(PieceData): ๋ณ€์ˆ˜๋ช… ์ˆ˜์ •
juntae6942 Apr 2, 2026
36c2748
refactor(View): view ๋ถ„๋ฆฌ์— ๋”ฐ๋ฅธ ์ค‘๋ณต Map ์ œ๊ฑฐ
juntae6942 Apr 2, 2026
8d2ca59
refactor(Service): ๋™์‹œ์„ฑ ์ œ์–ด๋ฅผ ์œ„ํ•ด Map์œผ๋กœ ํ•„๋“œ ๋ณ€๊ฒฝ
juntae6942 Apr 3, 2026
c404444
refactor(Repository): nullableํ•˜์ง€ ์•Š์€ ๋ฉ”์„œ๋“œ ์ˆ˜์ •
juntae6942 Apr 3, 2026
0029a5a
refactor(Repository): ์ปค๋„ฅ์…˜ํ’€๋กœ ๋ณ€๊ฒฝ
juntae6942 Apr 3, 2026
825229e
refactor(Service): ๊ฒŒ์ž„๋ฐฉ ID ๊ฒ€์ฆ ์ถ”๊ฐ€
juntae6942 Apr 3, 2026
5f46ac9
refactor(Repository): ํŠธ๋žœ์žญ์…˜ ์ถ”๊ฐ€
juntae6942 Apr 3, 2026
6cb316d
refactor(Repository): ํŠธ๋žœ์žญ์…˜ ํ…œํ”Œ๋ฆฟ ์ ์šฉ
juntae6942 Apr 3, 2026
ce5ea69
refactor(Controller): primitive type์œผ๋กœ ์ˆ˜์ • ๋ฐ roomId ๊ฒ€์ฆ ์ถ”๊ฐ€
juntae6942 Apr 3, 2026
c631ad5
refactor(Service): ํŒŒ๋ผ๋ฏธํ„ฐ ๋„ค์ด๋ฐ ์ˆ˜์ • ๋ฐ primitive type ๋ณ€๊ฒฝ
juntae6942 Apr 3, 2026
24c9daa
refactor(Piece): getTeam() ์ถ”๊ฐ€
juntae6942 Apr 3, 2026
e0430f8
refactor(Service): ๋™์‹œ์„ฑ ์ œ์–ด
juntae6942 Apr 3, 2026
b04d73e
refactor(Repository): DB ์ปค๋„ฅ์…˜ ๊ด€๋ฆฌ ๋ถ„๋ฆฌ ๋ฐ roomId ๊ฒ€์ฆ ์ด๋™
juntae6942 Apr 3, 2026
315983e
refactor(Repository): DB ์ปค๋„ฅ์…˜ ๊ด€๋ฆฌ ๋ถ„๋ฆฌ ๋ฐ roomId ๊ฒ€์ฆ ์ด๋™
juntae6942 Apr 3, 2026
f4419bb
refactor(Controller): ํ•„์š”์—†์–ด์ง„ ๋ฉ”์„œ๋“œ ์ œ๊ฑฐ
juntae6942 Apr 3, 2026
41a7302
refactor(init): unique ์ œ์•ฝ์กฐ๊ฑด ์ถ”๊ฐ€
juntae6942 Apr 3, 2026
dfd5eb3
refactor(Board): ๊ฐ€์‚ฐ์  ๊ณ„์‚ฐ ์ฑ…์ž„ ๋ถ„๋ฆฌ
juntae6942 Apr 3, 2026
8f1c77a
refactor(GameRoom): ์˜ˆ์™ธ์ฒ˜๋ฆฌ ์ถ”๊ฐ€
juntae6942 Apr 3, 2026
252829d
refactor(Repository): ์˜ˆ์™ธ์ฒ˜๋ฆฌ ์ถ”๊ฐ€
juntae6942 Apr 3, 2026
8bdf44d
refactor(Castle): ๊ถ์„ฑ ๊ธฐ๋Šฅ ๋ถ„๋ฆฌ
juntae6942 Apr 3, 2026
40e5f49
test(HanScore): ํ•œ๋‚˜๋ผ ๋ณด๋„ˆ์Šค ์ ์ˆ˜ ๊ณ„์‚ฐ ์ฑ…์ž„ ์œ„์ž„์— ๋”ฐ๋ฅธ ํ…Œ์ŠคํŠธ ์ˆ˜์ •
juntae6942 Apr 3, 2026
db8cf19
refactor(Team): ๋ฐฉํ–ฅ ํŒ๋‹จ team์— ์œ„์ž„
juntae6942 Apr 3, 2026
d3297ea
refactor(BoardStatus): view ์˜์กด์  ๋ฉ”์„œ๋“œ ๋ถ„๋ฆฌ
juntae6942 Apr 3, 2026
2343f65
refactor(Repository): status ์ˆ˜์ •์— ๋”ฐ๋ฅธ ๋กœ์ง ์ˆ˜์ •
juntae6942 Apr 3, 2026
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
89 changes: 86 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- [X] ํ˜„์žฌ ์œ„์น˜์™€ ์ด๋™ํ•  ์œ„์น˜ ์ž…๋ ฅ ์•ˆ๋‚ด ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ (์˜ˆ: 1,1 1,2)
- [X] ์‚ฌ์šฉ์ž ์ž…๋ ฅ ๋ฐ›๊ธฐ
- [X] ์ž…๋ ฅ๊ฐ’ ์•ž๋’ค ๊ณต๋ฐฑ ์ œ๊ฑฐ
- [X] ์‚ฌ์šฉ์ž๋กœ๋ถ€ํ„ฐ ๊ฒŒ์ž„ ์„ ํƒ ์ž…๋ ฅ ๋ฐ›๊ธฐ
- [X] ์ƒˆ๋กœ์šด ๊ฒŒ์ž„ ์„ ํƒ ์—ฌ๋ถ€ ์ž…๋ ฅ๋ฐ›๊ธฐ(y,n)
- [X] n ์ž…๋ ฅ์‹œ ๊ธฐ์กด ๊ฒŒ์ž„๋ฐฉ ID ์ž…๋ ฅ๋ฐ›๊ธฐ


### ์žฅ๊ธฐ ๊ฒŒ์ž„ (JanggiGame)
- [X] ์žฅ๊ธฐ ๊ฒŒ์ž„ ํ๋ฆ„ ๊ด€๋ฆฌ
Expand All @@ -31,6 +35,7 @@
- [X] ๊ธฐ๋ฌผ(Piece)์ด ๋ฐ˜ํ™˜ํ•œ ์ด๋™ ๊ฒฝ๋กœ ์ƒ์— ๋‹ค๋ฅธ ๊ธฐ๋ฌผ(์žฅ์• ๋ฌผ)์ด ์žˆ๋Š”์ง€ ์ตœ์ข… ๊ฒ€์ฆ (๊ธธ๋ง‰ํž˜ ํŒ๋ณ„)
- [X] ๊ฒ€์ฆ ํ†ต๊ณผ ์‹œ ๋ณด๋“œ ์ƒํƒœ ์—…๋ฐ์ดํŠธ (๊ธฐ๋ฌผ ์ด๋™)
- [X] ๋„์ฐฉ์ง€์— ์ ๊ตฐ ๊ธฐ๋ฌผ์ด ์žˆ๋‹ค๋ฉด ๋งต์—์„œ ์ œ๊ฑฐ (ํฌํš ์ฒ˜๋ฆฌ)
- [X] ํ˜„์žฌ ์ ์ˆ˜ ๊ณ„์‚ฐ ๊ฒฐ๊ณผ ๋ฐ˜ํ™˜

#### ๊ธฐ๋ฌผ ๊ณตํ†ต (Piece - ์›€์ง์ž„ ์ „๋žต ํŒจํ„ด)
- [X] ๊ธฐ๋ฌผ์˜ ์†Œ์† ํŒ€(ํ•œ/์ดˆ) ๋ฐ˜ํ™˜
Expand All @@ -51,8 +56,9 @@
### ๐Ÿ“ค ์ถœ๋ ฅ (OutputView)
#### ๊ฒŒ์ž„ ์ง„ํ–‰ ์ƒํƒœ ์ถœ๋ ฅ
- [X] ๊ฒŒ์ž„ ์‹œ์ž‘ ์•ˆ๋‚ด ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ
- [ ] ๋งค ํ„ด๋งˆ๋‹ค ํ˜„์žฌ ๋ˆ„๊ตฌ์˜ ํ„ด์ธ์ง€ ์ถœ๋ ฅ
- [X] ๋งค ํ„ด๋งˆ๋‹ค ํ˜„์žฌ ๋ˆ„๊ตฌ์˜ ํ„ด์ธ์ง€ ์ถœ๋ ฅ
- [X] ๋งค ํ„ด๋งˆ๋‹ค ์ด๋™ ๊ฒฐ๊ณผ๊ฐ€ ๋ฐ˜์˜๋œ ํ˜„์žฌ ์žฅ๊ธฐํŒ์˜ ์ƒํƒœ๋ฅผ ์‹œ๊ฐ์ ์œผ๋กœ ์ถœ๋ ฅ
- [X] ๋งค ํ„ด๋งˆ๋‹ค ํ˜„์žฌ ์ ์ˆ˜ ์ถœ๋ ฅ

#### ๊ฒŒ์ž„ ์ข…๋ฃŒ ์ถœ๋ ฅ
- [X] ์Šน๋ฆฌ ํŒ€ ์•ˆ๋‚ด ๋ฐ ๊ฒŒ์ž„ ์ข…๋ฃŒ ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ
Expand All @@ -63,5 +69,82 @@
#### ๊ตฌํ˜„๋˜์ง€ ์•Š์€ ๊ธฐ๋Šฅ
- ์ƒ๋งˆ์ƒ๋งˆ, ๋งˆ์ƒ๋งˆ์ƒ ๋“ฑ์˜ ์ƒ์ฐจ๋ฆผ ๋ณ€๊ฒฝ์€ ๋ฏธ๊ตฌํ˜„
- ์™ธํ†ต์ˆ˜ ์‹œ ๊ฒŒ์ž„์„ ์ข…๋ฃŒํ•˜๋Š” ๊ธฐ๋Šฅ ๋ฏธ๊ตฌํ˜„(์žฅ์„ ์žก์„ ๋•Œ๊นŒ์ง€ ๊ฒŒ์ž„ ์ง„ํ–‰)
- ๊ถ์„ฑ์„ ๊ตฌํ˜„ํ•˜์ง€ ์•Š์•„์„œ, ์žฅ, ์‚ฌ์˜ ์ด๋™ ๋ฒ”์œ„ ์ œํ•œ์ด ํ˜„์žฌ๋Š” ์—†์Œ
- ๊ถ์„ฑ ๋‚ด๋ถ€์—์„œ์˜ ๊ธฐ๋ฌผ๋งˆ๋‹ค์˜ ํŠน์ˆ˜ํ•œ ์ด๋™ ๊ฒฝ๋กœ ๋˜ํ•œ ํ˜„์žฌ๋Š” ์—†์Œ


```mermaid
classDiagram
Piece <|.. Ma
Piece <|.. Cha
Piece <|.. Pho
Piece <|.. Sang
Piece <|.. Jang
Piece <|.. Sa
Piece <|.. Jol
Board -- Piece
GameTurn .. HanTurn
GameTurn .. ChoTurn
GameTurn .. FinishedGame
JanggiGame -- GameTurn
JanggiGame -- Board

class Point {
int x
int y
of(int x, int y)
}
class Piece {
Team team
isSameTeam(Team team)
getRoute(Point from, Point to)
canMove(List<Piece> route)
}
class Board {
Map~Point, Piece~ state
init()
move(Point from, Point to)
}
class JanggiGame {
Board board
GameTurn gameState
play()
}
class GameTurn {
Team team
<<interface>>
move()
}
class HanTurn {
Team han
move()
}
class ChoTurn {
Team cho
move()
}
class FinishedGame {
Team winner
move()
}
```
```mermaid
erDiagram
GameRoom ||--o{ Piece : "contains (1:N)"

GameRoom {
BIGINT id PK
VARCHAR current_turn
VARCHAR winner
DOUBLE cho_score
DOUBLE han_score
}

Piece {
BIGINT id PK
BIGINT game_room_id FK
VARCHAR piece_name
VARCHAR team
INT row_pos
INT col_pos
}

```
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repositories {
}

dependencies {
implementation 'com.h2database:h2:2.2.224'
testImplementation platform('org.junit:junit-bom:5.11.4')
testImplementation platform('org.assertj:assertj-bom:3.27.3')
testImplementation('org.junit.jupiter:junit-jupiter')
Expand Down
46 changes: 17 additions & 29 deletions src/main/java/janggi/JanggiApplication.java
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
package janggi;

import janggi.domain.Board;
import janggi.domain.JanggiGame;
import janggi.domain.Point;
import janggi.domain.piece.Piece;
import janggi.presentation.dto.GameStatusInfo;
import janggi.presentation.dto.MoveCommand;
import janggi.presentation.dto.PositionInfo;
import janggi.application.JanggiGameService;
import janggi.domain.board.BoardRepository;
import janggi.infra.DataConnectionManager;
import janggi.infra.JdbcBoardRepository;
import janggi.presentation.JanggiGameController;
import janggi.presentation.ui.InputView;
import janggi.presentation.ui.OutputView;
import janggi.util.Console;
import janggi.util.FileParser;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.sql.SQLException;
import org.h2.tools.Server;

public class JanggiApplication {
public static void main(String[] args) {
List<PositionInfo> positionInfos = FileParser.readCsvFile("/janggi.csv");
Map<Point, Piece> pieces = new LinkedHashMap<>();
positionInfos.forEach(info -> pieces.put(info.point(), info.piece()));
Board board = new Board();
board.init(pieces);
JanggiGame game = new JanggiGame(board);

OutputView.printGameStatus(GameStatusInfo.from(game.getBoardStatus()));
OutputView.printStartGame();
while (!game.isFinished()) {
MoveCommand points = InputView.readPoints();
game.play(points.from(), points.to());
OutputView.printGameStatus(GameStatusInfo.from(game.getBoardStatus()));
}
OutputView.printWinner(game.getWinner());
Console.close();
public static void main(String[] args) throws SQLException {
Server server = Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9092").start();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์—„๋ฐ€ํžˆ ์ด์•ผ๊ธฐํ•˜์ž๋ฉด, ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ DB ์„œ๋ฒ„๋ฅผ ์ผœ๊ณ  ๋„๋Š” ์ฑ…์ž„๋„ ํ•จ๊ป˜ํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ๋ณด์—ฌ์ง€๋„ค์š”.
build.gradle์€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์˜์กด ๊ด€๊ณ„๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ, H2 DB๋Š” Connector๋ฅผ ๋„˜์–ด Embedded server๋กœ ๋™์ž‘ํ•˜๊ณ  ์žˆ๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค.

ํ•„์ˆ˜๋กœ ๊ตฌํ˜„ํ•ด์•ผํ•˜๋Š” ๊ฒƒ์€ ์•„๋‹ˆ์ง€๋งŒ, ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด DB์˜ ์ƒ๋ช…์ฃผ๊ธฐ๋ฅผ ๊ด€๋ฆฌํ•˜์ง€ ์•Š๋„๋ก ํ•˜๋ ค๋ฉด ์–ด๋–ค ๋ฐฉ๋ฒ•์ด ์žˆ์„๊นŒ์š”?

Copy link
Copy Markdown
Author

@juntae6942 juntae6942 Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋„์›Œ์„œ ํ•  ์ˆ˜๋„ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ๋Š” ๊ฐœ๋ฐœ ํŽธ์˜์„ฑ๊ณผ ๋ฏธ์…˜ ํ™˜๊ฒฝ์„ ๊ณ ๋ คํ•ด์„œ ์ž„๋ฒ ๋””๋“œ ๋ฐฉ์‹์„ ์œ ์ง€ํ•˜๋Š” ๊ฒƒ์ด ์ข‹๊ฒ ๋‹ค๊ณ  ํŒ๋‹จํ•˜์—ฌ ์‚ฌ์šฉํ–ˆ์—ˆ์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(์„ ํƒ) ์‹œ๊ฐ„์ด ๋งŽ์ด ๋‚จ์œผ์‹œ๊ฑฐ๋‚˜ ์‚ฌ์ดํด์˜ ์—ฐ์žฅ์„ ์œผ๋กœ ์ƒ๊ฐํ•˜์‹ ๋‹ค๋ฉด ๋„์ „ํ•ด๋ณด์…”๋„ ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค ใ…Žใ…Ž

DataConnectionManager manager = new DataConnectionManager();
BoardRepository repository = new JdbcBoardRepository(manager);
JanggiGameService service = new JanggiGameService(repository);
InputView inputView = new InputView();
OutputView outputView = new OutputView();
JanggiGameController controller = new JanggiGameController(service, inputView, outputView);
controller.run();
server.stop();
}
}
58 changes: 58 additions & 0 deletions src/main/java/janggi/application/JanggiGameService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package janggi.application;

import janggi.domain.board.Board;
import janggi.domain.board.BoardRepository;
import janggi.domain.JanggiGame;
import janggi.domain.point.Point;
import janggi.domain.status.ChoTurn;
import janggi.domain.status.Team;
import janggi.presentation.dto.GameStatusInfo;

public class JanggiGameService {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๋ฒˆ ์‚ฌ์ดํด์—์„œ ์ƒˆ๋กœ ๋“ค์–ด์˜จ Service์˜ ์ฑ…์ž„์€ ์–ด๋””๊นŒ์ง€๋ผ๊ณ  ๋ณด์•˜๋‚˜์š”? Service๊ฐ€ ํ•„์š”ํ•œ๊ฐ€? ๋ฅผ ์ด์•ผ๊ธฐํ•ด๋ณด๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„๋ฉ”์ธ ๋กœ์ง์„ ์บก์Аํ™”ํ•˜๊ณ , ํŠธ๋žœ์žญ์…˜์„ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด์„œ ํ•„์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ์ปจํŠธ๋กค๋Ÿฌ์—์„œ ๋งŒ์•ฝ repository๋ฅผ ๋‘๊ณ , ์‚ฌ์šฉํ•˜๊ฒŒ๋œ๋‹ค๋ฉด JanggiGame์ด ๋ฐ”๋กœ ๋…ธ์ถœ๋˜์–ด ์™ธ๋ถ€์˜ ๋ณ€๊ฒฝ์— ์˜ํ–ฅ์„ ๋ฐ›์„ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.


private final BoardRepository repository;

public JanggiGameService(BoardRepository repository) {
this.repository = repository;
}

public long startNewGame(Board initBoard) {
JanggiGame game = new JanggiGame(initBoard, new ChoTurn());
return repository.save(game);
}

public GameStatusInfo getBoardStatus(Long roomId) {
return GameStatusInfo.from(repository.loadGame(roomId).getBoardStatus());
}

public boolean isFinished(Long roomId) {
return repository.loadGame(roomId)
.isFinished();
}

public void play(Long roomId, Point from, Point to) {
JanggiGame game = repository.loadGame(roomId);
game.play(from, to);
repository.update(roomId, from, to, game);
Comment on lines +35 to +36
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update์— ์‹คํŒจํ•˜๋ฉด, ๋„๋ฉ”์ธ ๊ฐ์ฒด๋Š” ๋ณ€๊ฒฝ๋˜์—ˆ์œผ๋‚˜ DB์—๋Š” ๋ฐ˜์˜๋˜์ง€ ์•Š๋Š” ์ƒํ™ฉ์ด ์ผ์–ด๋‚  ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ์š”?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ผ์–ด๋‚  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋ฌด์ƒํƒœ์„ฑ์„ ์œ ์ง€ํ•˜๋„๋ก ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค!

}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR ์งˆ๋ฌธ์— ๋Œ€ํ•œ ์˜๊ฒฌ) play๊ฐ€ ๊ฐ์ฒด๋ฅผ ๋ณ€ํ˜•ํ•˜๊ณ  ์žˆ์œผ๋‹ˆ, ์ด๋ฅผ ๋ฐ˜ํ™˜ํ•˜์—ฌ ํ™œ์šฉํ•˜๋ฉด DB ๋ถ€ํ•˜๋ฅผ ์ค„์ผ ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ์š”? ๋™์‹œ์„ฑ๊ณผ DB ๋ถ€ํ•˜ ๋ชจ๋‘ ์ฑ™๊ธธ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š”.


public Team winner(Long roomId) {
return repository.loadGame(roomId)
.getWinner();
}

public Team currentTurn(Long roomId) {
return repository.loadGame(roomId)
.getTeam();
}

public double getHanScore(Long roomId) {
return repository.loadGame(roomId)
.getHanScore();
}

public double getChoScore(Long roomId) {
return repository.loadGame(roomId)
.getChoScore();
}
}
26 changes: 20 additions & 6 deletions src/main/java/janggi/domain/JanggiGame.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package janggi.domain;

import janggi.domain.board.Board;
import janggi.domain.piece.Piece;
import janggi.domain.status.ChoTurn;
import janggi.domain.point.Point;
import janggi.domain.status.GameStatus;
import janggi.domain.status.Team;
import java.util.List;
import java.util.Map;

public class JanggiGame {

private static final double BONUS_SCORE = 1.5;
private final Board board;
private GameStatus gameStatus;

public JanggiGame(Board board) {
public JanggiGame(Board board, GameStatus gameStatus) {
this.board = board;
this.gameStatus = new ChoTurn();
this.gameStatus = gameStatus;
}

public boolean isFinished() {
Expand All @@ -27,11 +29,23 @@ public Team getWinner() {
return gameStatus.getTeam();
}

public List<List<Piece>> getBoardStatus() {
return board.getPoints();
public Map<Point, Piece> getBoardStatus() {
return board.getPieces();
}

public void play(Point from, Point to) {
this.gameStatus = gameStatus.move(from, to, board);
}

public Team getTeam() {
return gameStatus.getTeam();
}

public double getChoScore() {
return board.calculateScore(Team.CHO);
}

public double getHanScore() {
return board.calculateScore(Team.HAN) + BONUS_SCORE;
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
package janggi.domain;
package janggi.domain.board;

import janggi.domain.piece.Piece;
import janggi.domain.piece.PieceType;
import janggi.domain.point.Point;
import janggi.domain.point.Points;
import janggi.domain.point.Route;
import janggi.domain.status.Team;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;
import java.util.stream.IntStream;

public class Board {

private static final int BOARD_HEIGHT = 10;
private static final int BOARD_WIDTH = 9;
private final Map<Point, Piece> pieces;

private Map<Point, Piece> pieces;

public Board() {
this.pieces = new LinkedHashMap<>();
}

public void init(Map<Point, Piece> pieces) {
public Board(Map<Point, Piece> pieces) {
this.pieces = pieces;
}

Expand All @@ -32,8 +26,8 @@ public void move(Point from, Point to, Team team) {
if (targetPiece != null && !piece.canCapture(targetPiece)) {
throw new IllegalArgumentException("[ERROR] ์ด ๊ธฐ๋ฌผ์€ ํ•ด๋‹น ํƒ€๊ฒŸ์„ ์žก์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.");
}
List<Point> route = piece.getRoute(from, to);
if (!piece.canMove(getPieces(route))) {
Points points = piece.getRoutePoints(from, to);
if (!piece.canMove(getRoute(points))) {
throw new IllegalArgumentException("[ERROR] ํ•ด๋‹น ๊ธฐ๋ฌผ์˜ ์ด๋™ ๊ฒฝ๋กœ์— ์žฅ์• ๋ฌผ์ด ์žˆ๊ฑฐ๋‚˜ ๊ทœ์น™์— ์–ด๊ธ‹๋‚ฉ๋‹ˆ๋‹ค.");
}
pieces.remove(from);
Expand All @@ -46,20 +40,23 @@ public boolean isKingDie() {
.count() < 2;
}

public List<List<Piece>> getPoints() {
return IntStream.range(0, BOARD_HEIGHT)
.mapToObj(row -> IntStream.range(0, BOARD_WIDTH)
.mapToObj(col -> Point.of(col, row))
.map(point -> this.pieces.get(point))
.toList()
).toList();
public Map<Point, Piece> getPieces() {
return Collections.unmodifiableMap(this.pieces);
}

public double calculateScore(Team team) {
return pieces.values()
.stream()
.filter(piece -> piece.isSameTeam(team))
.mapToInt(Piece::getScore)
.sum();
}

public List<Piece> getPieces(List<Point> point) {
return point.stream()
public Route getRoute(Points points) {
return new Route(points.getPoints().stream()
.map(pieces::get)
.filter(Objects::nonNull)
.toList();
.toList());
}

private void validateFromPoint(Point from, Team team) {
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/janggi/domain/board/BoardRepository.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package janggi.domain.board;

import janggi.domain.JanggiGame;
import janggi.domain.point.Point;

public interface BoardRepository {
long save(JanggiGame game);
void update(Long roomId, Point from, Point to, JanggiGame game);
JanggiGame loadGame(Long gameRoomId);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Long save(JanggiGame game);์˜ ๋ฐ˜ํ™˜๊ฐ’์€ nullableํ•œ๊ฐ€์š”?
  • JanggiGame loadGame(Long gameRoomId);์˜ ์ธ์ž๋กœ null์ด ๋“ค์–ด์™€๋„ ๊ดœ์ฐฎ์€๊ฐ€์š”?

}
Loading