What is more resource intensive, calling a proc everytime X calls Bump(), or putting it right into Bump()?
Before you mock me, I have my reasons...
If I put it right into Bump(), then I will be left with a VERY long Bump() function, i.e
thingy/Bump(atom/A)
if(A.istype(/obj/stuff/blag))
var/obj/stuff/blag/B = A
B.health-=number
//do blag specific stuff
else if(A.istype(/obj/stuff/blog))
var/obj/stuff/blog/B = A
B.health-=number
//do blog specific stuff
//I think you get where this is going, and there are around 10 or so of these that must be done
Whereas I can make a proc, e.g Bumped(), specifically change it for each of the atoms that when bumped do stuff,
and thus make my code alot cleaner, e.g
thingy/Bump(/obj/stuff/A)
A.Bumped(number)
obj/stuff/blag
proc/Bumped(number)
src.health-=number
//do blag specific stuff
What I'm wondering, is which is more resource intensive, efficient or for lack of a better phrase, less lag inductive.
kthx
R_shn_t