diff --git a/README.md b/README.md index 9bab3f8..8f93726 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,7 @@ nbt解析器 by shenjack writen in rust! + +感谢 @神楽坂柚咲/伊欧/langyo + +在编写过程中的帮助( diff --git a/src/data.rs b/src/data.rs index f8fafbd..861dc36 100644 --- a/src/data.rs +++ b/src/data.rs @@ -1,5 +1,7 @@ +use std::cell::RefCell; use std::collections::HashMap; use std::io::{Cursor, Read, Seek, SeekFrom}; +use std::rc::Rc; use std::sync::Arc; /// NBT 里除了字符串的长度量都是 i32 @@ -16,7 +18,7 @@ pub type Reader<'a> = Cursor<&'a [u8]>; #[derive(Debug, Clone)] pub enum NbtItem { Value(NbtValue), - Array(NbtList), + Array(NbtList), } /// 一个 NBT list 的基本素养 @@ -40,12 +42,16 @@ pub trait NbtListTrait { } /// 通过范型实现的 NBT List (其实包括了 NbtCompound) -#[derive(Debug, Clone)] -pub struct NbtList { - /// 内容 - pub value: T, +// #[derive(Debug, Clone)] +// pub struct NbtList { +// /// 内容 +// pub value: T, +// } +pub enum NbtList { + BoolArray(Rc>>) } + #[allow(unused)] impl NbtList where @@ -168,7 +174,7 @@ where [0x07] => { for _ in 0..len { for _ in 0..len { - vec.push(NbtItem::Array(NbtList::>::from_reader(value))); + vec.push(NbtItem::Array( todo!() )); } } }