mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 10:14:06 +02:00
todos
This commit is contained in:
parent
1348384ca3
commit
149c4e2339
4 changed files with 38 additions and 2 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1149,7 +1149,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tf-demo-parser"
|
||||
version = "0.6.3"
|
||||
version = "0.6.4"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"better-panic",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "tf-demo-parser"
|
||||
description = "parser for tf2 demo files"
|
||||
version = "0.6.3"
|
||||
version = "0.6.4"
|
||||
authors = ["Robin Appelman <robin@icewind.nl>"]
|
||||
edition = "2021"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
|
|
|||
|
|
@ -456,15 +456,23 @@ pub struct Cart {
|
|||
pub position: Vector,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]
|
||||
pub struct ControlPoint {
|
||||
pub owner: Team,
|
||||
pub cap_percentage: f32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, PartialEq)]
|
||||
pub enum Objective {
|
||||
Cart(Cart),
|
||||
ControlPoint(ControlPoint),
|
||||
}
|
||||
|
||||
impl Objective {
|
||||
pub fn as_cart(&self) -> Option<&Cart> {
|
||||
match self {
|
||||
Objective::Cart(cart) => Some(cart),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -684,6 +684,34 @@ impl GameStateAnalyser {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code, unused_variables)]
|
||||
pub fn handle_cp_entity(&mut self, entity: &PacketEntity, parser_state: &ParserState) {
|
||||
const OWNERS: [SendPropIdentifier; 5] = [
|
||||
SendPropIdentifier::new("m_iOwner", "000"),
|
||||
SendPropIdentifier::new("m_iOwner", "001"),
|
||||
SendPropIdentifier::new("m_iOwner", "002"),
|
||||
SendPropIdentifier::new("m_iOwner", "003"),
|
||||
SendPropIdentifier::new("m_iOwner", "004"),
|
||||
];
|
||||
const CAP_PERCENTAGE: [SendPropIdentifier; 5] = [
|
||||
SendPropIdentifier::new("m_flLazyCapPerc", "000"),
|
||||
SendPropIdentifier::new("m_flLazyCapPerc", "001"),
|
||||
SendPropIdentifier::new("m_flLazyCapPerc", "002"),
|
||||
SendPropIdentifier::new("m_flLazyCapPerc", "003"),
|
||||
SendPropIdentifier::new("m_flLazyCapPerc", "004"),
|
||||
];
|
||||
|
||||
let objective = self
|
||||
.state
|
||||
.objectives
|
||||
.entry(entity.entity_index)
|
||||
.or_insert_with(|| {
|
||||
Objective::Cart(Cart::default())
|
||||
});
|
||||
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn parse_user_info(
|
||||
&mut self,
|
||||
index: usize,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue