Open ICEREG1992 opened 2 months ago
Perhaps this is an opportunity for some interface/extension shenanigans? buttonTarget
and nextTarget
both extend Target
?
On second thought the split is mostly fine as "next" is only called onEnd while a "targets" is only called via controls. The separation there is natural and doesn't lead to any weird shenanigans other than some minor code duplication. Keeping open for a little bit in case I have any other thoughts
Describe the addition
We should refactor things to make a little more sense and re-use more code between
targets
andnext
style pointers.Context
A block/video can have one of two ways of pointing to the next block-- a
targets
property which contains the necessary info for buttons to show and let the user pick where to go, or anext
property that tells the video player what to play after the current video ends.Right now, we either have one or the other, but since a
targets
and anext
are two different data types, this makes code reusage really difficult.Proposed Solution