Trouv / bevy_ecs_ldtk

ECS-friendly ldtk plugin for bevy, leveraging bevy_ecs_tilemap
Other
630 stars 74 forks source link

feat!: use new `LevelIid` type in `LevelEvent`, `LevelSet`, and `LevelSelection`, plus other improvements #219

Closed Trouv closed 11 months ago

Trouv commented 11 months ago

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

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