Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/blocks/motionblocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/motionblocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class MotionBlocks : public IBlockSection
enum FieldValues
{
LeftRight,
AllAround,
DoNotRotate
DoNotRotate,
AllAround
};

std::string name() const override;
Expand Down
5 changes: 5 additions & 0 deletions test/blocks/motion_blocks_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down