by bluejekyll · 9y ago · 0 comments
I can't think of a reason. Having to index by enum seems like it could be error prone.
Also, in the init(), instead of looping over all indexes of the array and setting 0, couldn't a memset be used?
I haven't even checked to see if the final program uses it. It's the kind of thing, though, that you might go in thinking, "maybe I will need that", and it doesn't add too much overhead to your prototype.
You can have functions iterate through the array. You may want have special functions for each indexed item, but if there is something you want to do for all of them -- say save or load, you can iterate through the list.
The other stuff is more stylistic but I'd guess he writes a lot of assembly code, and the enum style translates easily to asm.
But it was written in 97 so personally I'd give him a break. It might be a style he picked-up from coding on some earlier projects where it made sense (Say, for speed, or because the compiler was garbage).