From 03780d6f9692d09523b39e4e452d994abe094d19 Mon Sep 17 00:00:00 2001 From: leok18 <178525594+leok18@users.noreply.github.com> Date: Tue, 24 Mar 2026 09:40:52 -0700 Subject: [PATCH] add stealing and other stuff ? --- lib/metrics.dart | 19 +++++++++++++++++-- lib/pages/raw_scout_report.dart | 13 ++++++++----- .../lovat_api/get_scout_report_analysis.dart | 11 +++++++++-- lib/reusable/team_auto_paths.dart | 16 ++++++++-------- 4 files changed, 42 insertions(+), 17 deletions(-) diff --git a/lib/metrics.dart b/lib/metrics.dart index ecad974..efc694f 100644 --- a/lib/metrics.dart +++ b/lib/metrics.dart @@ -235,6 +235,7 @@ List breakdowns = [ BreakdownSegmentData( localizedNameSingular: "Defending", path: "DEFENDING"), BreakdownSegmentData(localizedNameSingular: "Immobile", path: "IMMOBILE"), + BreakdownSegmentData(localizedNameSingular: "Stealing", path: "STEALING"), ], ), BreakdownData( @@ -370,8 +371,22 @@ List breakdowns = [ path: "STOP_TO_SHOOT", ), BreakdownSegmentData( - localizedNameSingular: "Dump", - path: "DUMP", + localizedNameSingular: "Push", + path: "PUSH", + ), + ], + ), + BreakdownData( + localizedName: "Stealing Type", + path: "stealerType", + segments: [ + BreakdownSegmentData( + localizedNameSingular: "To Alliance Zone", + path: "TO_ALLIANCE", + ), + BreakdownSegmentData( + localizedNameSingular: "To Neutral Zone", + path: "TO_NEUTRAL", ), ], ) diff --git a/lib/pages/raw_scout_report.dart b/lib/pages/raw_scout_report.dart index 0e072ab..1099820 100644 --- a/lib/pages/raw_scout_report.dart +++ b/lib/pages/raw_scout_report.dart @@ -739,11 +739,7 @@ extension EndgameClimbResultExtension on EndgameClimbResult { } } -enum FeederType { - continuous, - stopToShoot, - dump, -} +enum FeederType { continuous, stopToShoot, dump, push } extension FeederTypeName on FeederType { String get description { @@ -754,10 +750,17 @@ extension FeederTypeName on FeederType { return "Dump"; case FeederType.stopToShoot: return "Stop to Shoot"; + case FeederType.push: + return "Push"; } } } +enum StealerType { + toAlliance, + toNeutral, +} + enum AutoClimbResult { notAttempted, failed, diff --git a/lib/reusable/lovat_api/get_scout_report_analysis.dart b/lib/reusable/lovat_api/get_scout_report_analysis.dart index a896c35..9b265e7 100644 --- a/lib/reusable/lovat_api/get_scout_report_analysis.dart +++ b/lib/reusable/lovat_api/get_scout_report_analysis.dart @@ -43,6 +43,7 @@ class SingleScoutReportAnalysis { required this.climbStartTime, required this.feederType, required this.autoPath, + required this.stealerType, this.accuracy, required this.volleys, required this.ballsFed, @@ -61,12 +62,13 @@ class SingleScoutReportAnalysis { final num campingDefenseTime; final num scoringRate; final num feedingRate; - final num defenseEffectiveness; + final num? defenseEffectiveness; final num feeds; final num? accuracy; final EndgameClimbResult climbResult; final num climbStartTime; final List feederType; + final List stealerType; final AutoPath autoPath; final num volleys; final num ballsFed; @@ -91,7 +93,12 @@ class SingleScoutReportAnalysis { autoClimbStartTime: json['autoClimbStartTime'], contactDefenseTime: json['contactDefenseTime'], campingDefenseTime: json['campingDefenseTime'], - defenseEffectiveness: json["defenseEffectiveness"] + 1, + stealerType: ((json['stealerType'] as List).cast()) + .map((elem) => StealerType.values[elem]) + .toList(), + defenseEffectiveness: json["defenseEffectiveness"] != null + ? json["defenseEffectiveness"] + 1 + : null, feeds: json["feeds"], accuracy: json["accuracy"], climbStartTime: json["climbStartTime"], diff --git a/lib/reusable/team_auto_paths.dart b/lib/reusable/team_auto_paths.dart index cc2144b..370d6d9 100644 --- a/lib/reusable/team_auto_paths.dart +++ b/lib/reusable/team_auto_paths.dart @@ -993,25 +993,25 @@ extension AutoPathLocationExtension on AutoPathLocation { /// `x` and `y` are between `0` and `100`, starting from the top left of the field. Offset get offset { switch (this) { - case AutoPathLocation.leftTrench: + case AutoPathLocation.rightTrench: return const Offset(35, 10); - case AutoPathLocation.leftBump: + case AutoPathLocation.rightBump: return const Offset(35, 25); case AutoPathLocation.hub: return const Offset(42, 50); - case AutoPathLocation.rightTrench: + case AutoPathLocation.leftTrench: return const Offset(35, 90); - case AutoPathLocation.rightBump: + case AutoPathLocation.leftBump: return const Offset(35, 75); - case AutoPathLocation.startLeftTrench: + case AutoPathLocation.startRightTrench: return const Offset(45, 10); - case AutoPathLocation.startLeftBump: + case AutoPathLocation.startRightBump: return const Offset(45, 25); case AutoPathLocation.startHub: return const Offset(57.5, 50); - case AutoPathLocation.startRightTrench: + case AutoPathLocation.startLeftTrench: return const Offset(45, 90); - case AutoPathLocation.startRightBump: + case AutoPathLocation.startLeftBump: return const Offset(45, 75); case AutoPathLocation.neutralZone: return const Offset(20, 50);