Technically you can call the constructor from another method as you are doing here, but in general it’s not common practice. The constructor of a class is meant for object instantiation. All you are doing in the Reset()
method by calling the constructor is creating a temporary object and then immediately destroying it. A better solution would be to move the code in the constructor to an Init()
method, which can be called from Reset()
, and can also return a value (typically a bool or an Enumeration to indicate success or failure). Another common practice is using what’s known as an initializer list for members that should be initialized when a new object is instantiated (that might be getting ahead though, I haven’t gone through this section so I’m not sure if Ben covers them later on).
Side note - you don’t need the return;
at the end of Reset()
since it is a void
method.