object detonated

This commit is contained in:
Robin Appelman 2021-12-21 23:20:40 +01:00
commit fdd6fe498e
2 changed files with 16 additions and 0 deletions

View file

@ -249,6 +249,18 @@ pub fn killed_object_event_parser(input: &str) -> IResult<&str, KilledObjectEven
))
}
#[derive(Debug)]
pub struct ObjectDetonatedEvent<'a> {
pub object: Option<&'a str>,
pub position: Option<(i32, i32, i32)>,
}
pub fn object_detonated_event_parser(input: &str) -> IResult<&str, ObjectDetonatedEvent> {
let (input, object) = opt(param_parse("object"))(input)?;
let (input, position) = opt(param_parse_with("attacker_position", position))(input)?;
Ok((input, ObjectDetonatedEvent { object, position }))
}
#[derive(Debug)]
pub struct ExtinguishedEvent<'a> {
pub against: RawSubject<'a>,