This repository has been archived on 2025-07-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
miller/gamelog/src/play.rs
2025-03-27 13:04:02 -04:00

59 lines
1.0 KiB
Rust

use crate::error;
use serde::Deserialize;
#[derive(Debug, Deserialize, Clone)]
pub struct Play {
action: Option<Action>,
down: Down,
terrain: super::TerrainState,
}
#[derive(Debug, Deserialize, Clone)]
pub enum Action {
CrackStudentBodyRightTackle,
Curls,
FleaFlicker,
HalfbackSlam,
HalfbackSlipScreen,
HalfbackSweep,
Mesh,
PlayActionBoot,
PlayActionComebacks,
PlayActionPowerZero,
PowerZero,
SlantBubble,
SlotOut,
SpeedOption,
StrongFlood,
}
#[derive(Debug, Deserialize, Clone)]
pub enum Down {
Kickoff { offence: Team },
First,
Second,
Third,
Fourth,
PointAfterTouchdown,
}
impl Down {
fn get_offence(&self) -> Result<&Team, error::DownError> {
match self {
Self::Kickoff { offence } => Ok(offence),
_ => Err(error::DownError::NotKickoff),
}
}
}
#[derive(Debug, Deserialize, Clone)]
pub enum Team {
ArizonaState,
Colorado,
Iowa,
Nebraska,
SouthCarolina,
Syracuse,
TexasAnM,
}