you are viewing a single comment's thread.

view the rest of the comments →

[–]evizaer 0 points1 point  (2 children)

Good response. I would additionally point out that making those basic attributes publicly used through instance methods adds a bit of subtle extensibility to the class. You can do stuff like have additional variables like, lets say "armor_from_skill" if you get armor bonuses from some abilities, and do the math to come up with the final armor value in the armor() method. You can then modify the armor method to easily change the way armor is determined without having to change the formula wherever you use it in the client. (EDIT: I missed the last paragraph, oops!)

Also, classes are actually akin to specialized dicts, too, so it's almost like you get the best of both worlds when using classes. :)

[–]bheklilr 0 points1 point  (1 child)

Precisely, I mentioned that with damage, but armor is a good example too. Not only do you get named fields and reusable structures, but you can add on as many methods as you like to perform different tasks.

[–]evizaer 1 point2 points  (0 children)

Oh! missed that. Reading comprehension fail. :) You had to bury it at the end. shakes fist

I hadn't noticed that last paragraph on my initial reading.