CTranslateNodeCommand: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 06:09:33 -04:00
parent 9c554fc052
commit 2cf3ac718b
2 changed files with 10 additions and 12 deletions

View File

@ -3,16 +3,13 @@
#include "Editor/INodeEditor.h"
CTranslateNodeCommand::CTranslateNodeCommand()
: IUndoCommand("Translate"),
mpEditor(nullptr),
mCommandEnded(false)
: IUndoCommand("Translate")
{
}
CTranslateNodeCommand::CTranslateNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, const CVector3f& Delta, ETransformSpace TransformSpace)
: IUndoCommand("Translate"),
mpEditor(pEditor),
mCommandEnded(false)
mpEditor(pEditor)
{
mNodeList.reserve(rkNodes.size());

View File

@ -16,17 +16,18 @@ class CTranslateNodeCommand : public IUndoCommand
CVector3f NewPos;
};
QList<SNodeTranslate> mNodeList;
INodeEditor *mpEditor;
bool mCommandEnded;
INodeEditor *mpEditor = nullptr;
bool mCommandEnded = false;
public:
CTranslateNodeCommand();
CTranslateNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, const CVector3f& rkDelta, ETransformSpace TransformSpace);
int id() const;
bool mergeWith(const QUndoCommand *pkOther);
void undo();
void redo();
bool AffectsCleanState() const { return true; }
int id() const override;
bool mergeWith(const QUndoCommand *pkOther) override;
void undo() override;
void redo() override;
bool AffectsCleanState() const override { return true; }
static CTranslateNodeCommand* End();
};