pub struct Seeder<'a> {
pub templates: &'a [Template],
pub terrain: &'a HeightGrid<'a>,
pub cells: &'a mut Cells,
pub rng: &'a mut Random,
pub placed: &'a mut Vec<Placed>,
pub removed: &'a mut Vec<usize>,
pub animation_events: &'a mut Vec<(usize, String)>,
}Expand description
What the growth and spawn updates need: the cells, the templates, the random numbers, and the lists to fill.
Fields§
§templates: &'a [Template]The object templates.
terrain: &'a HeightGrid<'a>The ground’s heights.
cells: &'a mut CellsThe gameplay map.
rng: &'a mut RandomThe game’s random numbers.
placed: &'a mut Vec<Placed>The placed objects.
removed: &'a mut Vec<usize>The entities to remove, in the order they asked. They are removed after all buckets.
Original: drained by FUN_1400c9560.
animation_events: &'a mut Vec<(usize, String)>AnimAudioEvents that passed their probability: owning entity and the SoundEffect to play
there.
Original: FUN_14008d310.
Implementations§
Source§impl<'a> Seeder<'a>
impl<'a> Seeder<'a>
Sourcepub fn place_structures(
&mut self,
structures: &[(PlacedStructure, Option<usize>)],
sx: i32,
sy: i32,
)
pub fn place_structures( &mut self, structures: &[(PlacedStructure, Option<usize>)], sx: i32, sy: i32, )
The profile’s start structures, relative to the start cell.
Each is built in “instant” mode (Game |= 1), so the build component shows the last
(finished) mesh. Component setup draws nothing from the stream except the model’s variant;
buildings do not stamp the map on activation.
Original: FUN_1400a7490, FUN_14010cfb0.
Sourcepub fn spawn_child(
&mut self,
parent: usize,
entry: usize,
random_growth: bool,
disabled: bool,
) -> Option<usize>
pub fn spawn_child( &mut self, parent: usize, entry: usize, random_growth: bool, disabled: bool, ) -> Option<usize>
Startup uses random_growth=true; scheduled spawning uses false. The child is registered in the PARENT TEMPLATE’s bucket (not its own template’s bucket).
Original: FUN_1400560e0.
Sourcepub fn plant(&mut self, template: usize, cell: i32) -> usize
pub fn plant(&mut self, template: usize, cell: i32) -> usize
CreateNaturalResource’s start on a free cell: clone the template, place it in the cell, growth 0, then a random model variant and mesh, and register it.
Original: FUN_1400cbb20, FUN_1400c8bf0, FUN_14012ba10, FUN_140126280,
FUN_14012a8a0.
Sourcepub fn iterate(
&mut self,
scheduler: &mut EntityScheduler<usize>,
dt: f32,
temperature: f32,
disabled: bool,
) -> bool
pub fn iterate( &mut self, scheduler: &mut EntityScheduler<usize>, dt: f32, temperature: f32, disabled: bool, ) -> bool
One iteration of the placed entities’ growth components. disabled is the game’s bit 10,
which stops spawning and the change at full growth, but not growth or the decay in frost.
The callbacks of other components are not installed yet.
Original: FUN_1400c9560, then FUN_140125520.
Sourcepub fn iterate_with(
&mut self,
scheduler: &mut EntityScheduler<usize>,
dt: f32,
temperature: f32,
disabled: bool,
visit: &mut dyn FnMut(&mut Seeder<'_>, &mut EntityScheduler<usize>, usize, i64) -> bool,
) -> bool
pub fn iterate_with( &mut self, scheduler: &mut EntityScheduler<usize>, dt: f32, temperature: f32, disabled: bool, visit: &mut dyn FnMut(&mut Seeder<'_>, &mut EntityScheduler<usize>, usize, i64) -> bool, ) -> bool
Seeder::iterate with the scheduled update of entities without growth (visit
returns whether the models changed).