Struct initiative_core::world::demographics::Demographics
source · pub struct Demographics {
groups: GroupMapWrapper,
}
Fields§
§groups: GroupMapWrapper
Implementations§
source§impl Demographics
impl Demographics
pub fn new(groups: HashMap<(Species, Ethnicity), u64>) -> Self
pub fn shift_species(&self, species: &Species, amount: f64) -> Self
pub fn only_species(&self, species: &Species) -> Self
pub fn shift_ethnicity(&self, ethnicity: &Ethnicity, amount: f64) -> Self
pub fn only_ethnicity(&self, ethnicity: &Ethnicity) -> Self
pub fn shift_species_ethnicity( &self, species: &Species, ethnicity: &Ethnicity, amount: f64, ) -> Self
pub fn only_species_ethnicity( &self, species: &Species, ethnicity: &Ethnicity, ) -> Self
pub fn gen_species_ethnicity(&self, rng: &mut impl Rng) -> (Species, Ethnicity)
fn shift_by<F: Fn(&Species, &Ethnicity) -> bool>( &self, f: F, amount: f64, default: (Species, Ethnicity), ) -> Self
fn groups(&self) -> &HashMap<(Species, Ethnicity), u64>
Trait Implementations§
source§impl Clone for Demographics
impl Clone for Demographics
source§fn clone(&self) -> Demographics
fn clone(&self) -> Demographics
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Demographics
impl Debug for Demographics
source§impl Default for Demographics
impl Default for Demographics
source§impl<'de> Deserialize<'de> for Demographics
impl<'de> Deserialize<'de> for Demographics
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Demographics
impl PartialEq for Demographics
source§fn eq(&self, other: &Demographics) -> bool
fn eq(&self, other: &Demographics) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Demographics
impl Serialize for Demographics
impl Eq for Demographics
impl StructuralPartialEq for Demographics
Auto Trait Implementations§
impl Freeze for Demographics
impl RefUnwindSafe for Demographics
impl Send for Demographics
impl Sync for Demographics
impl Unpin for Demographics
impl UnwindSafe for Demographics
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)