diff options
Diffstat (limited to 'src/Generating/PiecePool.cpp')
-rw-r--r-- | src/Generating/PiecePool.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Generating/PiecePool.cpp b/src/Generating/PiecePool.cpp index 4b4303516..a7c28e75a 100644 --- a/src/Generating/PiecePool.cpp +++ b/src/Generating/PiecePool.cpp @@ -8,6 +8,7 @@ #include "PiecePool.h" #include "VerticalStrategy.h" #include "VerticalLimit.h" +#include "PieceModifier.h" @@ -46,6 +47,29 @@ bool cPiece::SetVerticalLimitFromString(const AString & a_LimitDesc, bool a_LogW +bool cPiece::SetPieceModifiersFromString(const AString & a_Definition, bool a_LogWarnings) +{ + auto modifiers = std::make_shared<cPieceModifiers>(); + if (!CreatePieceModifierFromString(a_Definition, modifiers, a_LogWarnings)) + { + return false; + } + + cPieceModifiers Modifiers; + for (size_t i = 0; i < modifiers->size(); i++) + { + Modifiers.push_back(std::move(modifiers->at(i))); + } + + m_Modifiers = Modifiers; + + return true; +} + + + + + Vector3i cPiece::RotatePos(const Vector3i & a_Pos, int a_NumCCWRotations) const { Vector3i Size = GetSize(); |