diff --git a/src/blocks/motionblocks.cpp b/src/blocks/motionblocks.cpp index b10dfa4f..73fbb129 100644 --- a/src/blocks/motionblocks.cpp +++ b/src/blocks/motionblocks.cpp @@ -59,6 +59,11 @@ void MotionBlocks::registerBlocks(IEngine *engine) // Fields engine->addField(this, "STYLE", STYLE); + + // Field values + engine->addFieldValue(this, "left-right", LeftRight); + engine->addFieldValue(this, "don't rotate", DoNotRotate); + engine->addFieldValue(this, "all around", AllAround); } void MotionBlocks::compileMoveSteps(Compiler *compiler) diff --git a/src/blocks/motionblocks.h b/src/blocks/motionblocks.h index b72f65f6..db354351 100644 --- a/src/blocks/motionblocks.h +++ b/src/blocks/motionblocks.h @@ -40,8 +40,8 @@ class MotionBlocks : public IBlockSection enum FieldValues { LeftRight, - AllAround, - DoNotRotate + DoNotRotate, + AllAround }; std::string name() const override; diff --git a/test/blocks/motion_blocks_test.cpp b/test/blocks/motion_blocks_test.cpp index ce33d74a..74b5419d 100644 --- a/test/blocks/motion_blocks_test.cpp +++ b/test/blocks/motion_blocks_test.cpp @@ -140,6 +140,11 @@ TEST_F(MotionBlocksTest, RegisterBlocks) // Fields EXPECT_CALL(m_engineMock, addField(m_section.get(), "STYLE", MotionBlocks::STYLE)); + // Field values + EXPECT_CALL(m_engineMock, addFieldValue(m_section.get(), "left-right", MotionBlocks::LeftRight)); + EXPECT_CALL(m_engineMock, addFieldValue(m_section.get(), "don't rotate", MotionBlocks::DoNotRotate)); + EXPECT_CALL(m_engineMock, addFieldValue(m_section.get(), "all around", MotionBlocks::AllAround)); + m_section->registerBlocks(&m_engineMock); }