refactor(model): game_state.dart 분할 (SRP 개선)
- Stats, Traits, Inventory, Equipment 등 11개 파일로 분리 - 단일 책임 원칙 적용으로 유지보수성 향상
This commit is contained in:
67
lib/src/core/model/task_info.dart
Normal file
67
lib/src/core/model/task_info.dart
Normal file
@@ -0,0 +1,67 @@
|
||||
import 'package:asciineverdie/src/core/animation/monster_size.dart';
|
||||
import 'package:asciineverdie/src/core/model/monster_grade.dart';
|
||||
|
||||
/// 태스크 타입 (원본 fTask.Caption 값들에 대응)
|
||||
enum TaskType {
|
||||
neutral, // heading 등 일반 이동
|
||||
kill, // 몬스터 처치
|
||||
load, // 로딩/초기화
|
||||
plot, // 플롯 진행
|
||||
market, // 시장으로 이동 중
|
||||
sell, // 아이템 판매 중
|
||||
buying, // 장비 구매 중
|
||||
}
|
||||
|
||||
/// 태스크 정보 (Task Info)
|
||||
class TaskInfo {
|
||||
const TaskInfo({
|
||||
required this.caption,
|
||||
required this.type,
|
||||
this.monsterBaseName,
|
||||
this.monsterPart,
|
||||
this.monsterLevel,
|
||||
this.monsterGrade,
|
||||
this.monsterSize,
|
||||
});
|
||||
|
||||
final String caption;
|
||||
final TaskType type;
|
||||
|
||||
/// 킬 태스크의 몬스터 기본 이름 (형용사 제외, 예: "Goblin")
|
||||
final String? monsterBaseName;
|
||||
|
||||
/// 킬 태스크의 전리품 부위 (예: "claw", "tail", "*"는 WinItem)
|
||||
final String? monsterPart;
|
||||
|
||||
/// 킬 태스크의 몬스터 레벨 (전투 스탯 계산용)
|
||||
final int? monsterLevel;
|
||||
|
||||
/// 킬 태스크의 몬스터 등급 (Normal/Elite/Boss)
|
||||
final MonsterGrade? monsterGrade;
|
||||
|
||||
/// 킬 태스크의 몬스터 사이즈 (애니메이션 크기 결정용, Act 기반)
|
||||
final MonsterSize? monsterSize;
|
||||
|
||||
factory TaskInfo.empty() =>
|
||||
const TaskInfo(caption: '', type: TaskType.neutral);
|
||||
|
||||
TaskInfo copyWith({
|
||||
String? caption,
|
||||
TaskType? type,
|
||||
String? monsterBaseName,
|
||||
String? monsterPart,
|
||||
int? monsterLevel,
|
||||
MonsterGrade? monsterGrade,
|
||||
MonsterSize? monsterSize,
|
||||
}) {
|
||||
return TaskInfo(
|
||||
caption: caption ?? this.caption,
|
||||
type: type ?? this.type,
|
||||
monsterBaseName: monsterBaseName ?? this.monsterBaseName,
|
||||
monsterPart: monsterPart ?? this.monsterPart,
|
||||
monsterLevel: monsterLevel ?? this.monsterLevel,
|
||||
monsterGrade: monsterGrade ?? this.monsterGrade,
|
||||
monsterSize: monsterSize ?? this.monsterSize,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user