-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I would like to see a high level API for creating entities in the simulation, using something like factory structs with a fluent interface. e.g.:
BeamBuilder()
.in_direction(Vector3::x)
.with_gaussian_profile(waist, power)
.with_sigma_plus_polarisation()
.for_cooling(Strontium)
.with_detuning(-32.0)
.build(&mut world);
The advantages of this are:
- user doesn't need to know components required.
- guarantees safe use/initialization of components.
- prosaic code.
- reduces redundancy for duplicate variables (e.g. wavevector)
- nicer editor integration, e.g. autocomplete/prompting. Helpful for new atomecs users.
Disadvantages:
- more code to maintain.
- multiple ways to define things (though this can be alleviated by funnelling users towards higher-level functionality in an
atomecs::prelude::*
mod.
Originally posted by @ElliotB256 in #29 (comment)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request