Open
Conversation
Collaborator
corock-dev
commented
Aug 3, 2024
- 다음 주에 리팩터링 예정입니다.
Closed
Closed
| } | ||
|
|
||
| @Override | ||
| public String getMessage() { |
Collaborator
There was a problem hiding this comment.
추상메서드를 다음과 같이 구현하기보단,
컴포지션을 사용했으면 어떨까 싶네요
|
|
||
| protected void takeHit(int power) { | ||
| this.damage = power; | ||
| int strength = this.hp - power; |
Collaborator
There was a problem hiding this comment.
strength면 통상 "힘"이라는 용어로 쓰이는데요,
체력(hp) - power가 왜 "힘"이 되는지 해당 메서드만으로는 단번에 이해가 어려워보여요
Comment on lines
+82
to
+101
| interface Displayable { | ||
| int getValue(); | ||
| } | ||
|
|
||
| /** | ||
| * A Stats class is an enum types that GameCharacter has. | ||
| */ | ||
| public enum Stats implements Displayable { | ||
| SOLDIER_INIT_LEVEL(1), SOLDIER_INIT_HP(100), SOLDIER_INIT_POWER(10), | ||
| SLIME_LEVEL(1), SLIME_HP(30), SLIME_POWER(4), | ||
| ORC_LEVEL(2), ORC_HP(40), ORC_POWER(6), | ||
| DRAGON_LEVEL(3), DRAGON_HP(100), DRAGON_POWER(10), | ||
| DRAGON_SPECIAL_MOVE(7), DRAGON_BREATH(15); | ||
|
|
||
| private final int value; | ||
|
|
||
| Stats(int value) { | ||
| this.value = value; | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
클래스 안에 Inteface와 구현체가 동시에 있는 구조는 처음 보는데요,
이렇게 사용하는 이유가 뭘까요?
| } | ||
|
|
||
| @Override | ||
| public String getMessage() { |
Collaborator
There was a problem hiding this comment.
역할이라는 관점을 봤을 때,
Output인 메시지를 Orc가 출력해주는게 맞을까요?
|
|
||
| try { | ||
| soldierAttack.start(); | ||
| Thread.sleep(500); |
| } | ||
|
|
||
| GameCharacter loser = getLoser(soldier, monster); | ||
| if (isLoserSoldierOrDragon(loser, soldier.getUserId())) { |
Collaborator
There was a problem hiding this comment.
isLoserSoldierOrDragon 메서드 명이 약간 모호한느낌이 들어요.
| * The mode that displays configurations for the game. | ||
| */ | ||
| public enum Mode implements Displayable { | ||
| PRESS_ENTER(""), ENTER_DUNGEON("1"), ATTACK("1"), QUIT("2"); |
corock
pushed a commit
that referenced
this pull request
Sep 15, 2024
corock
pushed a commit
that referenced
this pull request
Jan 26, 2025
error: getId() in Sender cannot override getId() in Thread
private final String id;
return type String is not compatible with long
614e370 to
5984ef9
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.