Skip to content

Commit 861ab08

Browse files
committed
IBlockSection: Add hat block API
1 parent 94c1f4f commit 861ab08

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/engine/iblocksection.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ class IBlockSection
8383
m_compileFunctions[opcode] = f;
8484
}
8585

86+
/*!
87+
* Registers a hat block.
88+
* \param[in] opcode The block opcode
89+
*/
90+
virtual void addHatBlock(const std::string &opcode) { addCompileFunction(opcode, &dummyFunction); }
91+
8692
/*! Assigns an input ID to an input name. */
8793
virtual void addInput(const std::string &name, int id) final { m_inputs[name] = id; }
8894

@@ -93,6 +99,7 @@ class IBlockSection
9399
virtual void addFieldValue(const std::string &value, int id) final { m_fieldValues[value] = id; }
94100

95101
private:
102+
static void dummyFunction(Compiler *compiler){};
96103
std::map<std::string, BlockComp> m_compileFunctions;
97104
std::map<std::string, int> m_inputs;
98105
std::map<std::string, int> m_fields;

0 commit comments

Comments
 (0)