pub struct Wild<'a, 't> {
pub wildlife: &'a mut Wildlife,
pub placed: &'a mut Vec<Placed>,
pub templates: &'a [Template],
pub cells: &'a Cells,
pub terrain: &'a HeightGrid<'t>,
pub rng: &'a mut Random,
pub scheduler: &'a mut EntityScheduler<usize>,
}Expand description
The town state wildlife reads and writes.
Fields§
§wildlife: &'a mut WildlifeThe animals.
placed: &'a mut Vec<Placed>The placed objects.
templates: &'a [Template]The object templates.
cells: &'a CellsThe gameplay map.
terrain: &'a HeightGrid<'t>The ground’s heights.
rng: &'a mut RandomThe game’s random numbers.
scheduler: &'a mut EntityScheduler<usize>The entity scheduler.
Implementations§
Source§impl Wild<'_, '_>
impl Wild<'_, '_>
Source§impl Wild<'_, '_>
impl Wild<'_, '_>
Sourcepub fn assign(&mut self, a: usize, to: Option<usize>)
pub fn assign(&mut self, a: usize, to: Option<usize>)
The animal joins pasture to (or the town’s list) and leaves its old one; leaving a pasture
it turns wild, joining one it keeps to its area.
Original: FUN_140129190.
Sourcepub fn fill(&mut self, p: usize)
pub fn fill(&mut self, p: usize)
A pasture with room takes the waiting livestock of its kind, in the town list’s order, until full.
Original: FUN_14012c610.
Sourcepub fn births(&mut self, p: usize) -> Vec<usize>
pub fn births(&mut self, p: usize) -> Vec<usize>
Each animal with young due has them, while the pasture holds fewer than three over its room (the animals born join the end of the list and are seen too). Born animals are registered by the caller.
Original: FUN_14012c840.
Sourcepub fn give_birth(
&mut self,
p: usize,
parent: Option<usize>,
buckets: bool,
) -> Option<usize>
pub fn give_birth( &mut self, p: usize, parent: Option<usize>, buckets: bool, ) -> Option<usize>
A young animal of the pasture’s kind next to its parent (or anywhere in the pasture, any age
under a year, without one); male more likely the more females there are. With buckets it
joins the entity manager’s buckets here, else the caller’s.
Original: FUN_14012db40.
Sourcepub fn start_livestock(
&mut self,
template: usize,
count: i32,
at: [f32; 3],
spread: f32,
)
pub fn start_livestock( &mut self, template: usize, count: i32, at: [f32; 3], spread: f32, )
The starting livestock of a kind, count animals around at (spread either way), males
and females in turn from a random first; any age under a year. They wait, wild, for a
pasture.
Original: FUN_1400a5fe0.
Sourcepub fn trade_livestock(
&mut self,
template: usize,
count: i32,
a: [f32; 3],
b: [f32; 3],
area: [i16; 4],
)
pub fn trade_livestock( &mut self, template: usize, count: i32, a: [f32; 3], b: [f32; 3], area: [i16; 4], )
Livestock bought at a trading post, count animals at random between its first two create
points (a, b), males and females in turn from a random first, turned at random; not
wild, they keep to the cells between the points (area) until a pasture takes them. Each is
RandFloat × half its lifespan old (the lifespan is drawn when the entity is made). The
owner registers the entities.
Original: FUN_14005b640.
Sourcepub fn mark_breeder(&mut self, p: usize)
pub fn mark_breeder(&mut self, p: usize)
The pasture’s message 0 (a rancher’s visit): a random animal of it may breed.
Original: FUN_14012cbf0.