Wire season flow: map screen, progress save, win recording, next stage
SaveRepository (versioned JSON over prefs) with best-result merging and unlock walking; ContentRepository loads the bundled pack; SeasonFlow/ Progress notifiers orchestrate stage start -> win record -> advance. Season map grid with stars/locks, Home -> Map -> Game navigation, close button, next-stage action on the win overlay. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../game/models/season.dart';
|
||||
|
||||
/// Resolves season content. Phase 3: bundled assets only; remote download
|
||||
/// and caching land in Phase 4.
|
||||
class ContentRepository {
|
||||
static const bundledSeasonIds = ['season_001'];
|
||||
|
||||
Future<SeasonPack> loadBundledSeason(String seasonId) async {
|
||||
final raw =
|
||||
await rootBundle.loadString('assets/seasons/$seasonId/pack.json');
|
||||
return SeasonPack.fromJson(jsonDecode(raw) as Map<String, dynamic>);
|
||||
}
|
||||
|
||||
Future<List<SeasonPack>> availableSeasons() async => [
|
||||
for (final id in bundledSeasonIds) await loadBundledSeason(id),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user