handle some more event types

This commit is contained in:
Robin Appelman 2023-03-11 22:56:46 +01:00
commit 3ad9ebafd7
5 changed files with 33 additions and 5 deletions

View file

@ -93,14 +93,29 @@ pub enum GameEvent<'a> {
PointCaptured(PointCapturedEvent<'a>),
CurrentScore(CurrentScoreEvent),
BuiltObject(BuiltObjectEvent<'a>),
DropObject(DropObjectEvent<'a>),
CarryObject(BuiltCarryEvent<'a>),
KilledObject(KilledObjectEvent<'a>),
Extinguished(ExtinguishedEvent<'a>),
GameOver(GameOverEvent<'a>),
FinalScore(FinalScoreEvent),
ObjectDetonated(ObjectDetonatedEvent<'a>),
Request(UnparsedEvent<'a>),
Response(UnparsedEvent<'a>),
LogFileClosed,
}
#[derive(Debug)]
pub struct UnparsedEvent<'a> {
pub params: &'a str,
}
impl<'a> Event<'a> for UnparsedEvent<'a> {
fn parse(input: &'a str) -> IResult<Self> {
Ok(("", UnparsedEvent { params: input }))
}
}
pub struct ParamIter<'a> {
input: &'a str,
}