mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
28 lines
460 B
Rust
28 lines
460 B
Rust
|
// Library
|
||
|
use vek::*;
|
||
|
|
||
|
pub trait BaseVol {
|
||
|
type Vox;
|
||
|
type Err;
|
||
|
}
|
||
|
|
||
|
pub trait SizedVol: BaseVol {
|
||
|
const SIZE: Vec3<u32>;
|
||
|
}
|
||
|
|
||
|
pub trait ReadVol: BaseVol {
|
||
|
#[inline(always)]
|
||
|
fn get(&self, pos: Vec3<i32>) -> Result<&Self::Vox, Self::Err>;
|
||
|
}
|
||
|
|
||
|
pub trait WriteVol: BaseVol {
|
||
|
#[inline(always)]
|
||
|
fn set(&mut self, pos: Vec3<i32>, vox: Self::Vox) -> Result<(), Self::Err>;
|
||
|
}
|
||
|
|
||
|
// Utility traits
|
||
|
|
||
|
pub trait VolSize {
|
||
|
const SIZE: Vec3<u32>;
|
||
|
}
|