fix
This commit is contained in:
parent
7f0be36c30
commit
c4a0c6b0c5
1 changed files with 10 additions and 8 deletions
|
|
@ -12,27 +12,29 @@ pub enum EntityOrigin {
|
||||||
World
|
World
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Entity {
|
// FString type should be reference
|
||||||
|
|
||||||
|
pub struct Entity<'a> {
|
||||||
origin: EntityOrigin,
|
origin: EntityOrigin,
|
||||||
tag: Option<Tag>,
|
tag: Option<Tag>,
|
||||||
pub id: usize,
|
pub id: usize,
|
||||||
pub flags: u32,
|
pub flags: u32,
|
||||||
pub type_idx: u16,
|
pub type_idx: u16,
|
||||||
pub type_name: FString,
|
pub type_name: &'a FString,
|
||||||
pub esh: ESH,
|
pub esh: ESH,
|
||||||
enc_size: usize
|
enc_size: usize
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct EntityOpt {
|
pub struct EntityOpt<'b> {
|
||||||
pub origin: EntityOrigin,
|
pub origin: EntityOrigin,
|
||||||
pub flags: u32,
|
pub flags: u32,
|
||||||
pub type_idx: u16,
|
pub type_idx: u16,
|
||||||
pub type_name: Option<FString>,
|
pub type_name: Option<&'b FString>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Decoder for Entity {
|
impl<'a> Decoder for Entity<'a> {
|
||||||
type Opt = EntityOpt;
|
type Opt = EntityOpt<'a>;
|
||||||
fn decode(raw: &Raw, offset: usize, _: usize, opt: Option<Self::Opt>) -> Result<Self> {
|
fn decode(raw: &Raw, offset: usize, _: usize, opt: Option<Self::Opt>) -> Result<Entity<'a>> {
|
||||||
let rd = ReadStream::new(raw, offset);
|
let rd = ReadStream::new(raw, offset);
|
||||||
let opt = match opt {
|
let opt = match opt {
|
||||||
Some(opt) => opt,
|
Some(opt) => opt,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue