refactor: used loaded over mounted (#179)

pull/183/head
Alejandro Santiago 3 years ago committed by GitHub
parent bf0596846b
commit f9cd93b77e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,8 +21,7 @@ mixin Layered<T extends Forge2DGame> on BodyComponent<T> {
set layer(Layer value) {
_layer = value;
if (!isLoaded) {
// TODO(alestiago): Use loaded.whenComplete once provided.
mounted.whenComplete(_applyMaskBits);
loaded.whenComplete(_applyMaskBits);
} else {
_applyMaskBits();
}

@ -57,8 +57,6 @@ void main() {
const expectedLayer = Layer.spaceshipEntranceRamp;
final component = TestLayeredBodyComponent()..layer = expectedLayer;
await game.ensureAdd(component);
// TODO(alestiago): modify once component.loaded is available.
await component.mounted;
_expectLayerOnFixtures(
fixtures: component.body.fixtures,
@ -79,8 +77,6 @@ void main() {
component.layer = expectedLayer;
await game.ensureAdd(component);
// TODO(alestiago): modify once component.loaded is available.
await component.mounted;
_expectLayerOnFixtures(
fixtures: component.body.fixtures,

Loading…
Cancel
Save