Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5623: Start creating a few object types to define a merge operation
- Loading branch information
1 parent
c862c0a
commit 684abd2
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma once | ||
|
||
namespace scene | ||
{ | ||
|
||
namespace merge | ||
{ | ||
|
||
enum class ActionType | ||
{ | ||
|
||
}; | ||
|
||
// Represents a single operation during a merge process | ||
// There are various types of actions, i.e. brush addition, | ||
// entity removal, keyvalue change, etc. | ||
class MergeAction | ||
{ | ||
private: | ||
ActionType _type; | ||
|
||
public: | ||
MergeAction(ActionType type) : | ||
_type(type) | ||
{} | ||
|
||
ActionType getType() const | ||
{ | ||
return _type; | ||
} | ||
}; | ||
|
||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include <list> | ||
#include <memory> | ||
#include "../SceneGraphComparer.h" | ||
#include "MergeAction.h" | ||
|
||
namespace scene | ||
{ | ||
|
||
namespace merge | ||
{ | ||
|
||
// A MergeOperation groups one or more merge actions | ||
// together in order to apply a set of changes to an existing map | ||
class MergeOperation | ||
{ | ||
private: | ||
std::list<MergeAction> _actions; | ||
|
||
public: | ||
using Ptr = std::shared_ptr<MergeOperation>; | ||
|
||
static MergeOperation::Ptr CreateFromComparisonResult(const ComparisonResult& comparisonResult) | ||
{ | ||
return std::make_shared<MergeOperation>(); | ||
} | ||
}; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters