feat: implement base architecture and core repositories for weapon tracking and target analysis functionality
This commit is contained in:
@@ -3,14 +3,14 @@ class Shot {
|
||||
final double x; // Relative position (0.0 - 1.0)
|
||||
final double y; // Relative position (0.0 - 1.0)
|
||||
final int score;
|
||||
final String sessionId;
|
||||
final String analysisId;
|
||||
|
||||
Shot({
|
||||
required this.id,
|
||||
required this.x,
|
||||
required this.y,
|
||||
required this.score,
|
||||
required this.sessionId,
|
||||
required this.analysisId,
|
||||
});
|
||||
|
||||
Shot copyWith({
|
||||
@@ -18,14 +18,14 @@ class Shot {
|
||||
double? x,
|
||||
double? y,
|
||||
int? score,
|
||||
String? sessionId,
|
||||
String? analysisId,
|
||||
}) {
|
||||
return Shot(
|
||||
id: id ?? this.id,
|
||||
x: x ?? this.x,
|
||||
y: y ?? this.y,
|
||||
score: score ?? this.score,
|
||||
sessionId: sessionId ?? this.sessionId,
|
||||
analysisId: analysisId ?? this.analysisId,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class Shot {
|
||||
'x': x,
|
||||
'y': y,
|
||||
'score': score,
|
||||
'session_id': sessionId,
|
||||
'analysis_id': analysisId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,13 +45,13 @@ class Shot {
|
||||
x: (map['x'] as num).toDouble(),
|
||||
y: (map['y'] as num).toDouble(),
|
||||
score: map['score'] as int,
|
||||
sessionId: map['session_id'] as String,
|
||||
analysisId: map['analysis_id'] as String? ?? map['session_id'] as String? ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Shot(id: $id, x: $x, y: $y, score: $score, sessionId: $sessionId)';
|
||||
return 'Shot(id: $id, x: $x, y: $y, score: $score, analysisId: $analysisId)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -62,11 +62,11 @@ class Shot {
|
||||
other.x == x &&
|
||||
other.y == y &&
|
||||
other.score == score &&
|
||||
other.sessionId == sessionId;
|
||||
other.analysisId == analysisId;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return id.hashCode ^ x.hashCode ^ y.hashCode ^ score.hashCode ^ sessionId.hashCode;
|
||||
return id.hashCode ^ x.hashCode ^ y.hashCode ^ score.hashCode ^ analysisId.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user