Consistently typing level iids throughout our API will help prevent bugs in bevy_ecs_ldtk, and will help users prevent bugs in their own code as well. Receiving a LevelIid in various places in the ECS API will eventually be even more helpful when we provide features allowing users to lookup raw/loaded level data by reference using a LevelIid.
I also made some other refactors here. For one, I moved each of these types into their own modules. This won't be their final resting place, but I think it'll be easier to move them around later if these items are lonely.
Changes
add LevelSelection::iid constructor for creating that variant from a string.
add LevelIid::get for getting the internal value as a &String
update many doc links for consistent formatting and linking dependencies with https
update systems to use LevelIid where necessary, and even improve performance in a couple spots.
add some trivial doctests/tests for the affected types
implement IntoIterator and FromIterator for LevelSet
refactor LevelIid, LevelSet and LevelSelection into their own private modules without changing imports
Breaking
BEGIN_COMMIT_OVERRIDE
feat!: use new LevelIid type in LevelEvent, LevelSet, and LevelSelection, plus other improvements (#219)
feat!: change LevelEvent inner types from String to LevelIid (#219)
feat!: change LevelSet inner type from String to LevelIid (#219)
feat!: change LevelSelection::Iid inner type from String to LevelIid (#219)
feat!: replace LevelSet::from_iid with LevelSet::from_iids, which can convert from any collection of strings. (#219)
END_COMMIT_OVERRIDE
Consistently typing level iids throughout our API will help prevent bugs in
bevy_ecs_ldtk
, and will help users prevent bugs in their own code as well. Receiving aLevelIid
in various places in the ECS API will eventually be even more helpful when we provide features allowing users to lookup raw/loaded level data by reference using aLevelIid
.I also made some other refactors here. For one, I moved each of these types into their own modules. This won't be their final resting place, but I think it'll be easier to move them around later if these items are lonely.
Changes
LevelSelection::iid
constructor for creating that variant from a string.LevelIid::get
for getting the internal value as a&String
LevelIid
where necessary, and even improve performance in a couple spots.IntoIterator
andFromIterator
forLevelSet
LevelIid
,LevelSet
andLevelSelection
into their own private modules without changing importsBreaking
BEGIN_COMMIT_OVERRIDE feat!: use new LevelIid type in LevelEvent, LevelSet, and LevelSelection, plus other improvements (#219)
feat!: change
LevelEvent
inner types fromString
toLevelIid
(#219) feat!: changeLevelSet
inner type fromString
toLevelIid
(#219) feat!: changeLevelSelection::Iid
inner type fromString
toLevelIid
(#219) feat!: replaceLevelSet::from_iid
withLevelSet::from_iids
, which can convert from any collection of strings. (#219) END_COMMIT_OVERRIDE