74 lines
1.9 KiB
Dart
74 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../providers.dart';
|
|
import '../../game/config.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
class BattleHeader extends StatelessWidget {
|
|
const BattleHeader({super.key});
|
|
|
|
String _getStageDisplayString(int stage) {
|
|
// 3 Stages per Tier logic
|
|
// Tier 1: 1, 2, 3 -> Underground Illegal Arena
|
|
// Tier 2: 4, 5, 6 -> Colosseum
|
|
// Tier 3: 7, 8, 9 -> King's Arena
|
|
|
|
final int tier = (stage - 1) ~/ 3 + 1;
|
|
final int round = (stage - 1) % 3 + 1;
|
|
String tierName = "";
|
|
|
|
switch (tier) {
|
|
case 1:
|
|
tierName = "지하 불법 투기장";
|
|
break;
|
|
case 2:
|
|
tierName = "콜로세움";
|
|
break;
|
|
case 3:
|
|
default:
|
|
tierName = "왕의 투기장";
|
|
break;
|
|
}
|
|
|
|
return "$tierName - $round";
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final battleProvider = context.watch<BattleProvider>();
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Flexible(
|
|
child: FittedBox(
|
|
fit: BoxFit.scaleDown,
|
|
child: Text(
|
|
_getStageDisplayString(battleProvider.stage),
|
|
style: const TextStyle(
|
|
color: ThemeConfig.textColorWhite,
|
|
fontSize: ThemeConfig.fontSizeLarge,
|
|
fontWeight: ThemeConfig.fontWeightBold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Flexible(
|
|
child: FittedBox(
|
|
fit: BoxFit.scaleDown,
|
|
child: Text(
|
|
"${AppStrings.turn} ${battleProvider.turnCount}",
|
|
style: const TextStyle(
|
|
color: ThemeConfig.textColorWhite,
|
|
fontSize: ThemeConfig.fontSizeHeader,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|