mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added partial chunk loading, package section to workspace Cargo.toml
Former-commit-id: 4164daf4ccbe6695f664a44d0fce0ee10df39b8d
This commit is contained in:
parent
507c47e771
commit
3112486005
@ -1,3 +1,9 @@
|
||||
[package]
|
||||
name = "veloren"
|
||||
description = "Veloren is an open-world, open-source multiplayer voxel RPG."
|
||||
documentation = "https://docs.veloren.net"
|
||||
repository = "https://www.gitlab.com/veloren/veloren"
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"common",
|
||||
|
@ -144,6 +144,10 @@ impl Client {
|
||||
// Handle new messages from the server
|
||||
frontend_events.append(&mut self.handle_new_messages()?);
|
||||
|
||||
self.state.terrain().iter().for_each(|(k, _)| {
|
||||
println!("Chunk at {:?}", k);
|
||||
});
|
||||
|
||||
// Step 1
|
||||
if let Some(ecs_entity) = self.player {
|
||||
// TODO: remove this
|
||||
|
@ -141,4 +141,22 @@ impl<V: Vox, S: VolSize, M> VolMap<V, S, M> {
|
||||
pub fn pos_key(&self, pos: Vec3<i32>) -> Vec3<i32> {
|
||||
Self::chunk_key(pos)
|
||||
}
|
||||
|
||||
pub fn iter<'a>(&'a self) -> ChunkIter<'a, V, S, M> {
|
||||
ChunkIter {
|
||||
iter: self.chunks.iter(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ChunkIter<'a, V: Vox, S: VolSize, M> {
|
||||
iter: std::collections::hash_map::Iter<'a, Vec3<i32>, Chunk<V, S, M>>,
|
||||
}
|
||||
|
||||
impl<'a, V: Vox, S: VolSize, M> Iterator for ChunkIter<'a, V, S, M> {
|
||||
type Item = (Vec3<i32>, &'a Chunk<V, S, M>);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.iter.next().map(|(k, c)| (*k, c))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user