mod settlement; // Reexports pub use self::settlement::Settlement; use crate::{ block::ZCache, column::ColumnSample, util::{Grid, Sampler}, }; use common::{ terrain::Block, vol::{BaseVol, WriteVol}, }; use std::sync::Arc; use vek::*; #[derive(Clone)] pub enum Site { Settlement(Arc), } impl Site { pub fn radius(&self) -> f32 { match self { Site::Settlement(settlement) => settlement.radius(), } } pub fn get_surface(&self, wpos: Vec2) -> Option { match self { Site::Settlement(settlement) => settlement.get_surface(wpos), } } pub fn apply_to( &self, wpos2d: Vec2, zcaches: &Grid>, vol: &mut (impl BaseVol + WriteVol), ) { match self { Site::Settlement(settlement) => settlement.apply_to(wpos2d, zcaches, vol), } } } impl From for Site { fn from(settlement: Settlement) -> Self { Site::Settlement(Arc::new(settlement)) } }