Suprcode / Zircon

Legend of Mir 3 - Official Public Zircon Source
337 stars 256 forks source link

PlayerObject DX Refactor #76

Closed FluffyDuckyEU closed 1 year ago

FluffyDuckyEU commented 1 year ago

Hey Suprcode, before I make any more progress what are your thoughts on this?

Personally I don't like the way I have to instansiate the manager, but I conciously chose a concrete class so I could move and manage all the images and drawing separate from the player object.

https://github.com/Suprcode/mir3-zircon/pull/76/commits/814eeac892e8ea5f25458aea1ba0df187a3d93ad#diff-77e10abd04ca4a78bc27cf7c12c0429548381255375523586d3e2dbadbed2afeR296-R298

I have second thoughts about the concrete class now, maybe I should make them static and pass player into each method separately instead, but then player object would still have to own the libraries which is not ideal.

Suprcode commented 1 year ago

I don't really agree with this refactoring - it seems to be taking code out of main view without any gain. And as you mention creating lots of small instances or static classes of everything is less than ideal.

DXShadowBoundary is getting called and instantiated every draw - setting the public properties, then they're being destroyed and called all over again during the next draw - all for the sake of having 1 method removed from the main class.

I see the approach you're aiming for, but certainly think it needs some more thinking about