1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-04 02:24:12 +02:00

track cart

This commit is contained in:
Robin Appelman 2025-06-26 20:22:00 +02:00
commit 1348384ca3
4 changed files with 48 additions and 3 deletions

View file

@ -451,6 +451,24 @@ impl Kill {
}
}
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
pub struct Cart {
pub position: Vector,
}
#[derive(Debug, Serialize, Deserialize, PartialEq)]
pub enum Objective {
Cart(Cart),
}
impl Objective {
pub fn as_cart(&self) -> Option<&Cart> {
match self {
Objective::Cart(cart) => Some(cart),
}
}
}
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
#[non_exhaustive]
pub struct GameState {
@ -465,6 +483,7 @@ pub struct GameState {
pub interval_per_tick: f32,
pub outer_map: HashMap<Handle, EntityId>,
pub events: Vec<(DemoTick, GameEvent)>,
pub objectives: BTreeMap<EntityId, Objective>,
}
impl GameState {