Is operator overloading useful in game developing? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is operator overloading useful in game developing?

28th Dec 2016, 10:02 PM
Andrea
Andrea - avatar
3 Answers
+ 4
@Nahuel Ovejero that is function overloading, not operator overloading; though a good example nonetheless. As for the question, however, I can't answer as my field is not game development.
29th Dec 2016, 12:47 AM
Cohen Creber
Cohen Creber - avatar
+ 2
Its all depends in how you want to code the game. lets say you have the function shoot, and its overload to take as paremeters the type of gun, so instead of making 10 shoot function for each weapon, they will be the same, and easy to remember by the name.
28th Dec 2016, 10:20 PM
Nahuel
Nahuel - avatar
+ 2
Indeed @Cohen Crebee, I missread. Anyway, every knowldge can be handy.
29th Dec 2016, 12:56 AM
Nahuel
Nahuel - avatar