/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #ifndef AZTOOLSFRAMEWORK_SELECTIONCOMMAND_H #define AZTOOLSFRAMEWORK_SELECTIONCOMMAND_H #pragma once #include #include #include #include #include #include namespace AzToolsFramework { /** * Stores an entity selection set for undo/redo. */ class SelectionCommand : public UndoSystem::URSequencePoint { public: AZ_CLASS_ALLOCATOR(SelectionCommand, AZ::SystemAllocator, 0); AZ_RTTI(SelectionCommand, "{07A0CF6A-79FA-4EA3-B056-1C0DA6F36699}", UndoSystem::URSequencePoint); SelectionCommand(const AZStd::vector& proposedSelection, const AZStd::string& friendlyName); virtual void UpdateSelection(const AZStd::vector& proposedSelection); virtual void Post(); void Undo() override; void Redo() override; bool Changed() const override { return m_previousSelectionList != m_proposedSelectionList; } const AZStd::vector& GetInitialSelectionList() const; protected: EntityIdList m_previousSelectionList; EntityIdList m_proposedSelectionList; }; } // namespace AzToolsFramework #endif // AZTOOLSFRAMEWORK_SELECTIONCOMMAND_H