MostAwesomeDude/bravo — Issue #373: Unification of Location, Vector, Tuple, etc.
Author: Varriount
Created: 2011-10-23 00:36:56+00:00
State: open

I have written a fair amount of coordinate code lately, and have observed that there's a large amount of inconsistency within bravo's code on the handling and data types of coordinates. A look at the mob class in entity.py shows this; the amount of coordinate manipulation in the update function alone takes up about 30 lines when formatted nicely, out of about 55 lines of code that update() takes up in total. Most of this manipulation is simple stuff, adding tuples and locations together, running an action designed for one number through all three coordinate numbers, etc.

Therefore, to improve the overall readability and consistency of code, I propose 3 things:

* That the location class be modified so that it is subscriptable;

* The location and tuple using functions be modified to use this subscriptability where appropriate;

* That a vector class be created which mimics the coordinate (x,y,and z) qualities of the location class (along with subscriptability).