Outsource the Shape trait, wquadtree, and shape types.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
//! See https://github.com/fitzgen/generational-arena/blob/master/src/lib.rs.
|
||||
//! This has been modified to have a fully deterministic deserialization (including for the order of
|
||||
//! Index attribution after a deserialization of the arena.
|
||||
use buckler::partitioning::IndexedData;
|
||||
use std::cmp;
|
||||
use std::iter::{self, Extend, FromIterator, FusedIterator};
|
||||
use std::mem;
|
||||
@@ -51,6 +52,16 @@ pub struct Index {
|
||||
generation: u64,
|
||||
}
|
||||
|
||||
impl IndexedData for Index {
|
||||
fn default() -> Self {
|
||||
Self::from_raw_parts(crate::INVALID_USIZE, crate::INVALID_U64)
|
||||
}
|
||||
|
||||
fn index(&self) -> usize {
|
||||
self.into_raw_parts().0
|
||||
}
|
||||
}
|
||||
|
||||
impl Index {
|
||||
/// Create a new `Index` from its raw parts.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user