16 Commits

Author SHA1 Message Date
95f2847f06 [fix-remove-children-issue] BaseComponent removes children marked as shouldRemove during update (#600)
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-01-03 22:48:29 +01:00
480990265b BaseComponent should return immutable chlidren iterable (#594)
* Add changelog entry

* Change to Iterator to minimize performance hit

* Revert "Change to Iterator to minimize performance hit"

This reverts commit e7260aa507d4a57441e798ee0ba40cd09a776417.

* Return UnmodifiableListView for children

* Update changelog

* Add generics

* Links in comment for children getter
2020-12-29 16:32:19 +01:00
a6eb12202a Fix issue in BaseComponent where addChild results in a TypeError (#593)
* [fix-add-child-issue] Fix issue in BaseComponent where addChild results in a TypeError

* [fix-add-child-issue] Change to using internal children set throughout BaseComponent
2020-12-28 20:22:39 +01:00
692213d5a4 Properly propagate onMount and onRemove to children (#579)
* Fix rendering of children

* Game loop handles other restore

* Properly propagate onMount and onRemove to children

* Use BaseGame on gestures to minimize confusion

* Fix linting

* All children don't need preparation

* Add composability example

* gameRef might not be defined

* Add mustCallSuper

* isMounted on game

* Remove unused gameRef argument

* Made isMounted only modifiable by the component

* Move dartdoc to public isMounted

* Fix formatting
2020-12-21 12:42:45 +01:00
7a81b029cb Fix rendering of children (#578)
* Fix rendering of children

* Game loop handles other restore
2020-12-20 21:23:58 +01:00
11628b1edb Adding tests and handling composed components 2020-12-12 18:28:00 +00:00
f917920f45 Fix children update and rendering (#565)
* Fix children update and rendering

* Add changelog

* Fix formatting

* Add note about addChildren and remove assert

* Re-add child.rendered test

* Add MockCanvas and use it for composed test
2020-12-11 13:14:36 +01:00
463c30c374 Support dragable components 2020-12-09 10:22:36 +00:00
a47f62b018 Add explanation to assert 2020-12-09 10:10:12 +00:00
1c36b6ebf1 Use relative import 2020-12-09 10:10:12 +00:00
c4e2021b6c Components with a gameRef doesn't require it as argument
For the addChild method
2020-12-09 10:10:12 +00:00
2818845f7e propagateToChildren should not handle this, only children 2020-12-09 10:10:11 +00:00
00e331b11e Update BaseComponent description 2020-12-09 10:10:11 +00:00
7f16df3a3a Children should be private 2020-12-09 10:10:11 +00:00
e8ee7a3a82 Move relevant parts from PositionComponent to BaseComponent 2020-12-09 10:10:11 +00:00
cf68a32c1b Keep component unopinionated 2020-12-09 10:10:11 +00:00