Jump to content

  • Log In with Google      Sign In   
  • Create Account


rozz666

Member Since 27 May 2007
Offline Last Active Jul 19 2014 05:21 AM
-----

Posts I've Made

In Topic: Reference initialization required.

15 April 2014 - 01:05 PM

 

In Python, references are mutable and their labels (referers)are changed to refer to other referents(objects) by using an = operation.

a=20
b=a
b=30 # Changing object refering-to (referent 30)
del a # Who cares?! b is referring to another object now. Object 20 is garbage collected.  
print b

Output:

30

 

Python reference are C++ pointers (they are also garbage collected, of course).


In Topic: "Vector" of types? (compile time template)

23 March 2014 - 03:00 PM

Have a look at Boost.MPL: http://www.boost.org/doc/libs/1_55_0/libs/mpl/doc/refmanual.html

It provides among other things containers and algorithms for types.


In Topic: Always running into a circular dependency

29 November 2013 - 10:35 AM

Why does an Entity has to know about the Scene?


In Topic: Unit Testing ftw?

11 October 2013 - 09:30 AM


In my view stepping through code is a must. Every game/app I've ever written, which haven't been massive amount of code, I've always stepped through every line at one point or another. Every time I implement a class or couple methods I step through them to make sure they do what I expect.

In my experience when I started using Unit TDD and Accepance TDD, I've never had to step through every line. That's what my tests are doing.

 

I'm also surprised that no one mentioned that writing unit tests improves the design of the application. It enforces separation of concerns, single responsibility principle, dependency inversion, etc., because it becomes difficult to unit test classes if they violate these principles. This, in turn, improves maintainability.


In Topic: Self-shadowing terrain idea - asking for feedback

24 September 2013 - 12:26 PM

If I understood correctly, you have a shadow function that depends on time (let's call it s(t)) and you want to describe this function. For this, you want to make is a smooth step function (_/---) so you just need to store the coefficients. Keep in mind though, that you need more than 2 values. s(t) looks more like this (sunrise ___/--day--\___ sunset), so you need at least 4 values. Still, it should be pretty easy to implement. This, of course, assumes fixed relation between the ground and the sun.


PARTNERS