mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 02:24:12 +02:00
building construction progress
This commit is contained in:
parent
15046e8744
commit
4b88c33bf2
2 changed files with 20 additions and 1 deletions
|
|
@ -209,6 +209,7 @@ pub struct Sentry {
|
|||
pub shells: u16,
|
||||
pub rockets: u16,
|
||||
pub is_mini: bool,
|
||||
pub construction_progress: f32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
|
|
@ -226,6 +227,7 @@ pub struct Dispenser {
|
|||
pub angle: f32,
|
||||
pub healing: Vec<UserId>,
|
||||
pub metal: u16,
|
||||
pub construction_progress: f32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
|
||||
|
|
@ -247,6 +249,7 @@ pub struct Teleporter {
|
|||
pub recharge_duration: f32,
|
||||
pub times_used: u16,
|
||||
pub yaw_to_exit: f32,
|
||||
pub construction_progress: f32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
|
|
@ -354,6 +357,14 @@ impl Building {
|
|||
Building::Teleporter(_) => BuildingClass::Teleporter,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn construction_progress(&self) -> f32 {
|
||||
match self {
|
||||
Building::Sentry(Sentry { construction_progress, .. })
|
||||
| Building::Dispenser(Dispenser { construction_progress, .. })
|
||||
| Building::Teleporter(Teleporter { construction_progress, .. }) => *construction_progress,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[non_exhaustive]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue