-
-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Change DialogueView to a mixin class (#2652)
The DialogueView is responsible for handling and (almost always) displaying the dialog to the user. A very common use case requires the DialogueView to be a PositionComponent or other visual component in the game. This would require extending from both PositionComponent and DialogueView. Problem: The current DialogueView implementation is an abstract class. Dart does not support multiple inheritance. This means that the case above is difficult to implement. Solution: Changing the DialogueView from an abstract class to a mixin class allows the developer to extend PositionComponent and mix in DialogueView. The class can now be used as a base class OR as a mixin. All existing tests still pass. An additional test has been added that validates the use as a mixin (extending one class and mixing in DialogueView).
- Loading branch information
1 parent
94963c3
commit f3d4158
Showing
2 changed files
with
127 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters