Equipping Methods in Design Philosophy
|
|
When writting an equipping methods that uses an associative list to keep track of what is equipped, is it better to:
Reference the list every time a value of a variable is needed from the item.
or
Copy the values of the variables to variables owned by the mob when the item is equipped. Then reference the mobs variables.
I have done it both ways, I think the first way would be more accurate and safer, but the second way would be faster getting the values of the variables. Any opinions?
|
I don't know the all the details but I would've assumed an associative list in DM is simply an object that can have variables added to it at runtime so there's no real speed difference between accessing a variable in an associative list and a normal variable.
Also, let's face it, we're talking about DM here. Even if there were differences in speeds of two different methods the more accurate and safer option would be the best.