1
0
Fork 0
cuberite-2a/src/Blocks/ClearMetaOnDrop.h

25 lines
598 B
C
Raw Normal View History

#pragma once
2014-07-14 20:21:17 +00:00
// mixin for use to clear meta values when the block is converted to a pickup
// Usage: inherit from this class, passing the parent class as the parameter Base
2014-07-17 20:50:58 +00:00
// For example to use in class Foo which should inherit Bar use
2014-07-14 20:21:17 +00:00
// class Foo : public cClearMetaOnDrop<Bar>;
2014-08-28 13:44:36 +00:00
template <class Base>
class cClearMetaOnDrop : public Base
{
public:
cClearMetaOnDrop(BLOCKTYPE a_BlockType) :
Base(a_BlockType)
{}
2016-02-05 21:45:45 +00:00
virtual ~cClearMetaOnDrop() {}
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
2014-07-14 19:33:30 +00:00
a_Pickups.push_back(cItem(this->m_BlockType));
}
};