turbulenz / turbulenz_engine

Turbulenz is a modular 3D and 2D game framework for making HTML5 powered games for browsers, desktops and mobile devices.
http://turbulenz.com
MIT License
4.55k stars 513 forks source link

Added interfaces for the different params parameters of the Physics2DDevice create methods #37

Closed dkorbar closed 10 years ago

dkorbar commented 10 years ago

I have added interfaces for most of the create methods of the Physics2DDevice class (e.g. createPointConstraint) as was already done for some methods like createMaterial.

This improves development in Visual Studio as it enables auto completition for these methods.

dkorbar commented 10 years ago

Hello Luca,

thank you for your feedback.

I am quite aware that a lot of these parameters aren't really optional. But since those parameters were "any" before, I would consider introducing interfaces with non optional parameters a breaking change and I didn't want to introduce that because I thought there might have been a reason for those parameters to allow any kind of input. ;-)

Regarding the broadphase interface: There was a compilation error when I tried to put the interface there. I'll check that later and do the necessary changes.

deltaluca commented 10 years ago

Sorry for the late reply, my github issue tracker tends to be fairly flooded and things can fall through.

Technically its a breaking change to the API to make the fields non-optional. But should it actually break anyone's code, then their code was already broken in the first place, and this change brings the code in-line with documentation.

Regarding the broadphase, I'd actually revert your change there (Adding validate() implementation). That 'validate()' in the Physics2DBroadphase interface should not be there at all and should be removed, it is not a required/used, nor documented member of the interface.

If you could make that last little change (including removing the validate() from the interface), we'd be happy to merge this in.

dkorbar commented 10 years ago

No problem. Ok, makes sense! :-)

I just commited that change to the interface and class.