-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE-REFACTOR] 배틀 api v1, v2 분리 (#469)
* refactor: 배틀 api v1, v2 분리 * refactor: BattleResultResponseV1 * [BE-REFACTOR] cloudfront 주소를 변경한다 (#465) * refactor: cloudfront url 수정 * refactor: 이미지 url 한 곳에서 관리 --------- Co-authored-by: unifolio0 <[email protected]> --------- Co-authored-by: unifolio0 <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
809f584
commit 5062795
Showing
5 changed files
with
107 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
30 changes: 30 additions & 0 deletions
30
backend/pokerogue/src/main/java/com/pokerogue/helper/battle/dto/BattleResultResponseV1.java
This file contains 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 com.pokerogue.helper.battle.dto; | ||
|
||
import com.pokerogue.helper.move.data.Move; | ||
import com.pokerogue.helper.move.data.MoveCategory; | ||
import com.pokerogue.helper.type.data.Type; | ||
|
||
public record BattleResultResponseV1( | ||
int power, | ||
double multiplier, | ||
double accuracy, | ||
String moveName, | ||
String moveDescription, | ||
String moveType, | ||
String moveCategory | ||
) { | ||
public static BattleResultResponseV1 from(Move move, double multiplier, double accuracy) { | ||
Type moveType = move.getType(); | ||
MoveCategory moveCategory = move.getMoveCategory(); | ||
|
||
return new BattleResultResponseV1( | ||
move.getPower(), | ||
multiplier, | ||
accuracy, | ||
move.getName(), | ||
move.getEffect(), | ||
moveType.getKoName(), | ||
moveCategory.getName() | ||
); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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