You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have a question in Chapter 6 RoboCatRTS.
In class CommandList, there is no copy constructor defined.
But in class TurnData, it calls copy constructor of CommandList in TurnData's main constructor.
I don't understand the intend for this code.
Is there some kind of life cycle issue about CommandList?
The text was updated successfully, but these errors were encountered:
Even though a copy constructor isn't defined in CommandList, there's going to be a default copy constructor provided by C++ that would invoke a copy of the deque member variable.
The reason why the TurnData makes a copy of the CommandList is because the input manager has only one CommandList that is reused for every turn. But all of the previous turn data is saved, so if the code didn't make a copy that would be lost.
Hello, I have a question in Chapter 6 RoboCatRTS.
In class CommandList, there is no copy constructor defined.
But in class TurnData, it calls copy constructor of CommandList in TurnData's main constructor.
I don't understand the intend for this code.
Is there some kind of life cycle issue about CommandList?
The text was updated successfully, but these errors were encountered: