Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions lib/metrics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ List<BreakdownData> breakdowns = [
BreakdownSegmentData(
localizedNameSingular: "Defending", path: "DEFENDING"),
BreakdownSegmentData(localizedNameSingular: "Immobile", path: "IMMOBILE"),
BreakdownSegmentData(localizedNameSingular: "Stealing", path: "STEALING"),
],
),
BreakdownData(
Expand Down Expand Up @@ -370,8 +371,22 @@ List<BreakdownData> 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",
),
],
)
Expand Down
13 changes: 8 additions & 5 deletions lib/pages/raw_scout_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down
11 changes: 9 additions & 2 deletions lib/reusable/lovat_api/get_scout_report_analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -61,12 +62,13 @@ class SingleScoutReportAnalysis {
final num campingDefenseTime;
final num scoringRate;
final num feedingRate;
final num defenseEffectiveness;
final num? defenseEffectiveness;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If defenseEffectiveness is null then will it properly hide the box in the UI? or will it say "null/5"?

final num feeds;
final num? accuracy;
final EndgameClimbResult climbResult;
final num climbStartTime;
final List<FeederType> feederType;
final List<StealerType> stealerType;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you showing this value anywhere in the UI?

final AutoPath autoPath;
final num volleys;
final num ballsFed;
Expand All @@ -91,7 +93,12 @@ class SingleScoutReportAnalysis {
autoClimbStartTime: json['autoClimbStartTime'],
contactDefenseTime: json['contactDefenseTime'],
campingDefenseTime: json['campingDefenseTime'],
defenseEffectiveness: json["defenseEffectiveness"] + 1,
stealerType: ((json['stealerType'] as List<dynamic>).cast<int>())
.map<StealerType>((elem) => StealerType.values[elem])
.toList(),
defenseEffectiveness: json["defenseEffectiveness"] != null
? json["defenseEffectiveness"] + 1
: null,
feeds: json["feeds"],
accuracy: json["accuracy"],
climbStartTime: json["climbStartTime"],
Expand Down
16 changes: 8 additions & 8 deletions lib/reusable/team_auto_paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading