Closed DarthSharkie closed 2 months ago
Looks good
Looks good to me
OK, will work on builder-izing the others. Thanks for the feedback!
Combiner and Image are yet to be done.
Docs still need to be moved/updated, too.
Code is done, I believe. I will hold off on dealing with ParticleImage
-- it needs more than just a builder added.
Docs are still pending, will work on that next.
This provides the builder pattern for all
ParticleObjects
exceptParticleImage
. Circle and Cone were done as a preview for fully handling #35. The constructors become private, and the only method by which objects can be created is the staticbuilder()
method.This does move to use setters everywhere when setting properties from within a constructor so we get the same validity checks in both constructors and changes from interceptors. That requires the setters called from constructors (and any further methods they call) that are
public
orprotected
to be madefinal
so they cannot be overridden in a subclass and called before the subclass initializes.Examples from the
DebugParticleWand
:Like the other one, let me know how this looks, and I can finish the conversion across all ParticleObjects. I do think it would make sense to do #30 before this one, so the
beforeDraw
andafterDraw
interceptors move into theParticleObject.Builder
instead of being replicated about 16 times in our objects and require users to put them in their ownBuilder
implementations.This will also need a "How To: Create a new ParticleObject subclass" that explains the way these builders work so others can align with them. Ultimately, though, since they're owning their subclasses, Apel cannot control their precise implementations.