In order to better handle internal/external level storage, it will be helpful to a have a type that represents "complete" level data. For projects with internal levels, the normal levels embedded on the LdtkProject are "complete". For external level projects, the levels on the main project file are incomplete, and the complete data is stored separately.
This provides a type for representing complete level data. It does so by wrapping around Level by reference, and enforces the loadedness of the borrowed level on construction. It also provides immutable getters for all the level's fields, and .expects() away the fields that will not be null since the level is loaded (layer_instances).
Works towards #205.
In order to better handle internal/external level storage, it will be helpful to a have a type that represents "complete" level data. For projects with internal levels, the normal levels embedded on the LdtkProject are "complete". For external level projects, the levels on the main project file are incomplete, and the complete data is stored separately.
This provides a type for representing complete level data. It does so by wrapping around
Level
by reference, and enforces the loadedness of the borrowed level on construction. It also provides immutable getters for all the level's fields, and.expects()
away the fields that will not be null since the level is loaded (layer_instances
).