1, will the class of the object as a parameter to the weapon class, a function call weapon class, in the function of weapons classes to damage calculation such as the object,
2, sending weapons such as parameters, to the object, call a function object class, in the function of object class damage calculation processing,
Question:
1, this two ways, what are the advantages and disadvantages of each? Mainly from the performance, logic, and may consult the bug,
2, the two ways are suitable for what?
3, is there a better solution?
CodePudding user response:
Weapons just increase the damage of equipment, concrete damage and the main body must be role and made N a game without a put the main damage weapons...CodePudding user response:
The building Lord said the two I feel like there are many types of weapons, also have a variety of objects, is N: the relationship between N, upstairs was good thinking