| 1234567891011121314151617181920212223242526272829303132333435 |
- import 'package:app_business/service/api.dart';
- import 'package:fixnum/fixnum.dart';
- import 'package:get/get.dart';
- import 'package:track_common/model/map_info.dart';
- import 'package:track_common/service/map_watch.dart';
- import '../generated/base.pb.dart' as pb;
- import '../model/game_map.dart';
- class MapWatchImpl extends MapWatch {
- MapWatchImpl({required super.id});
- ApiService get _api => Get.find();
- @override
- Future<List<EventOnMap>> getEventList(int mapId) async {
- // final r = _api.stub
- return [];
- }
- }
- class MapWatchServiceImpl extends MapWatchService {
- ApiService get _api => Get.find();
- @override
- Future<MapWatch> newInstanceByMap(MapInfo info) async {
- final r =
- await _api.stub.toMapDetailV2(pb.IdRequest()..id = Int64(info.id));
- final instance = MapWatchImpl(id: info.id)
- ..name = r.mapName
- ..plugMap.gameMap = r.zipImage.toGameMap();
- return instance;
- }
- }
|