refactor separate framework from game code, add demo3d
This commit is contained in:
parent
19ae869769
commit
e576e9de6b
90 changed files with 2629 additions and 2347 deletions
26
demo3d/server/src/chunk.rs
Normal file
26
demo3d/server/src/chunk.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
pub mod stream;
|
||||
|
||||
use crate::bsp::Bsp;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
|
||||
pub enum ChunkId {
|
||||
Bsp { cx: i32, cz: i32 },
|
||||
}
|
||||
|
||||
pub enum Chunk {
|
||||
Bsp { cx: i32, cz: i32, bsp: Bsp, version: u32 },
|
||||
}
|
||||
|
||||
impl Chunk {
|
||||
pub fn version(&self) -> u32 {
|
||||
match self {
|
||||
Chunk::Bsp { version, .. } => *version,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_bsp(&self) -> Option<&Bsp> {
|
||||
match self {
|
||||
Chunk::Bsp { bsp, .. } => Some(bsp),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue