ICEREG1992 / fungwafrenzy

Modern Offline Client for FMV Cult Classic "Fung-Wa Frenzy"
MIT License
0 stars 0 forks source link

Revisit targets/next split #32

Open ICEREG1992 opened 2 months ago

ICEREG1992 commented 2 months ago

Describe the addition

We should refactor things to make a little more sense and re-use more code between targets and next 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 a next 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 a next are two different data types, this makes code reusage really difficult.

Proposed Solution

ICEREG1992 commented 2 months ago

Perhaps this is an opportunity for some interface/extension shenanigans? buttonTarget and nextTarget both extend Target?

ICEREG1992 commented 2 months ago

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