Quote from: Ryexander on May 11, 2009, 12:24:20 am
ok I see how this is simpler from a logic point of view but not speed or space
by using the case/when it keeps all the config and such in one place, it also doesn't require that you make two new variables per weapon, which take up more memory and don't work significantly faster than going through a case/when.
Also, it puts code in less classes (no more game_system) which can help keep the code sleeker and more compatible with other scripts that may also modify the same classes.
lastly, it's just as easy for someone to understand how to configure a case/when, if not a little easier, because the syntax is clear and is almost pseudocode. "when 1 then return 5" sounds like english whereas "$data_weapons[1].unleash_id = 5" can look pretty cryptic to noncoders.
edit:
oh and I forgot, you'd have to call $data_weapons.unleash_id(id) rather than $data_weapons[id].unleash_id, but that's not a significant difference tbh.