Files
asciinevrdie/lib/src/core/model/arena_match.dart
JiWoong Sul 699ae3b7f3 feat(arena): 아레나 서비스 및 아이템 서비스 개선
- ArenaService 로직 확장
- ArenaMatch 모델 업데이트
- ItemService 아레나 지원 추가
2026-01-07 20:21:50 +09:00

152 lines
3.7 KiB
Dart

import 'package:asciineverdie/src/core/model/equipment_slot.dart';
import 'package:asciineverdie/src/core/model/hall_of_fame.dart';
/// 아레나 대전 정보
///
/// 도전자와 상대의 정보, 양방향 베팅 슬롯을 포함
class ArenaMatch {
const ArenaMatch({
required this.challenger,
required this.opponent,
required this.challengerBettingSlot,
required this.opponentBettingSlot,
});
/// 도전자 (내 캐릭터)
final HallOfFameEntry challenger;
/// 상대 캐릭터
final HallOfFameEntry opponent;
/// 도전자 베팅 슬롯 (승리 시 상대에게서 빼앗을 슬롯)
final EquipmentSlot challengerBettingSlot;
/// 상대 베팅 슬롯 (상대 승리 시 도전자에게서 빼앗을 슬롯)
final EquipmentSlot opponentBettingSlot;
/// 도전자 순위
int get challengerRank => 0; // ArenaService에서 계산
/// 상대 순위
int get opponentRank => 0; // ArenaService에서 계산
/// 기존 bettingSlot 호환용 (deprecated)
@Deprecated('Use challengerBettingSlot instead')
EquipmentSlot get bettingSlot => challengerBettingSlot;
}
/// 아레나 대전 결과
class ArenaMatchResult {
const ArenaMatchResult({
required this.match,
required this.isVictory,
required this.turns,
required this.updatedChallenger,
required this.updatedOpponent,
});
/// 대전 정보
final ArenaMatch match;
/// 도전자 승리 여부
final bool isVictory;
/// 전투 턴 수
final int turns;
/// 장비 교환 후 업데이트된 도전자
final HallOfFameEntry updatedChallenger;
/// 장비 교환 후 업데이트된 상대
final HallOfFameEntry updatedOpponent;
}
/// 아레나 전투 턴 (애니메이션용)
class ArenaCombatTurn {
ArenaCombatTurn({
this.challengerDamage,
this.opponentDamage,
required this.challengerHp,
required this.opponentHp,
required this.challengerHpMax,
required this.opponentHpMax,
this.challengerMp,
this.opponentMp,
this.challengerMpMax,
this.opponentMpMax,
this.isChallengerCritical = false,
this.isOpponentCritical = false,
this.isChallengerEvaded = false,
this.isOpponentEvaded = false,
this.isChallengerBlocked = false,
this.isOpponentBlocked = false,
this.challengerSkillUsed,
this.opponentSkillUsed,
this.challengerHealAmount,
this.opponentHealAmount,
}) : timestamp = DateTime.now().microsecondsSinceEpoch;
/// 턴 식별용 타임스탬프
final int timestamp;
/// 도전자가 입힌 데미지 (null이면 공격 안 함)
final int? challengerDamage;
/// 상대가 입힌 데미지 (null이면 공격 안 함)
final int? opponentDamage;
/// 도전자 현재 HP
final int challengerHp;
/// 상대 현재 HP
final int opponentHp;
/// 도전자 최대 HP
final int challengerHpMax;
/// 상대 최대 HP
final int opponentHpMax;
/// 도전자 현재 MP
final int? challengerMp;
/// 상대 현재 MP
final int? opponentMp;
/// 도전자 최대 MP
final int? challengerMpMax;
/// 상대 최대 MP
final int? opponentMpMax;
/// 도전자 크리티컬 여부
final bool isChallengerCritical;
/// 상대 크리티컬 여부
final bool isOpponentCritical;
/// 도전자 회피 여부
final bool isChallengerEvaded;
/// 상대 회피 여부
final bool isOpponentEvaded;
/// 도전자 블록 여부
final bool isChallengerBlocked;
/// 상대 블록 여부
final bool isOpponentBlocked;
/// 도전자 사용 스킬명 (null이면 기본 공격)
final String? challengerSkillUsed;
/// 상대 사용 스킬명 (null이면 기본 공격)
final String? opponentSkillUsed;
/// 도전자 회복량
final int? challengerHealAmount;
/// 상대 회복량
final int? opponentHealAmount;
}