drakylucas
Intermediate OT User
- Joined
- Dec 15, 2015
- Messages
- 236
- Solutions
- 7
- Reaction score
- 121
I'm with this doubt...
Like, in the TFS, there are some small functions that are implemented only in the header files... So, what is the general rule about it, when do I need to just write the header and implement in the cpp file, and when I need just to implement in the header file?
example:
player.h
player.h
these functions (and many others) are implemented on header files only.
Thanks all!
Like, in the TFS, there are some small functions that are implemented only in the header files... So, what is the general rule about it, when do I need to just write the header and implement in the cpp file, and when I need just to implement in the header file?
example:
player.h
Code:
static uint64_t getExpForLevel(int32_t lv) {
lv--;
return ((50ULL * lv * lv * lv) - (150ULL * lv * lv) + (400ULL * lv)) / 3ULL;
}
player.h
Code:
void setName(std::string name) {
this->name = std::move(name);
}
Thanks all!