By jlnr (dev)
Date 2009-07-27 21:03
It would mean creating a lot more objects on the Ruby side. The not-so-technical overhead of it is that I would have to decide whether the points carry the color and z values with them, as they are always used in conjunction (one OpenGL vertex, so to speak), and whether there should be separate Size and Position classes or just a single Vector2D class, etc. I don't think adding them would be worth the complications. I still try to find time to get rid of the insane argument lists in other ways :)
If you are using the Ruby version of Gosu and Ruby 1.9, you can use argument splats in place of both arguments though, as in draw(*pos, z)
, where pos is an array of two numbers or any object that returns one in its to_a method. Or you can of course just monkey patch Gosu :)
hi, thanks for the quick reply :)
actually I'm using C++ so I wasn't aware of the Ruby complications.
I understand your point of view whether the class should include the color and/or z value when looking at the big picture, but for the future maybe an approach should be decided and just see how it works.
for now l guess I'll continue using my simple Point struct in my classes :)
Loading...