Update to gamelog v0.5.0
This commit is contained in:
@@ -10,13 +10,30 @@ pub enum Event {
|
||||
Kickoff(Offence),
|
||||
Turnover(Offence),
|
||||
Penalty(TerrainState),
|
||||
Score(u8),
|
||||
Pat(PatPoints),
|
||||
Score(ScorePoints),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, PartialEq)]
|
||||
pub enum PatPoints {
|
||||
Fail,
|
||||
One,
|
||||
Two,
|
||||
pub enum ScorePoints {
|
||||
Touchdown,
|
||||
FieldGoal,
|
||||
Safety,
|
||||
PatFail,
|
||||
PatTouchdown,
|
||||
PatFieldGoal,
|
||||
PatSafety,
|
||||
}
|
||||
|
||||
impl ScorePoints {
|
||||
pub fn to_points(&self) -> u8 {
|
||||
match &self {
|
||||
Self::Touchdown => 6,
|
||||
Self::FieldGoal => 3,
|
||||
Self::Safety => 2,
|
||||
Self::PatFail => 0,
|
||||
Self::PatTouchdown => 2,
|
||||
Self::PatFieldGoal => 1,
|
||||
Self::PatSafety => 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user