2014-07-14 15:26:36 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-07-14 16:21:17 -04: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 16:50:58 -04:00
|
|
|
// For example to use in class Foo which should inherit Bar use
|
2014-07-14 16:21:17 -04:00
|
|
|
// class Foo : public cClearMetaOnDrop<Bar>;
|
|
|
|
|
2014-08-28 09:44:36 -04:00
|
|
|
template <class Base>
|
2014-07-14 15:26:36 -04:00
|
|
|
class cClearMetaOnDrop : public Base
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
cClearMetaOnDrop(BLOCKTYPE a_BlockType) :
|
|
|
|
Base(a_BlockType)
|
|
|
|
{}
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2017-05-20 02:16:28 -04:00
|
|
|
virtual ~cClearMetaOnDrop() override {}
|
2014-07-14 15:26:36 -04:00
|
|
|
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
|
|
|
{
|
2014-07-14 15:33:30 -04:00
|
|
|
a_Pickups.push_back(cItem(this->m_BlockType));
|
2014-07-14 15:26:36 -04:00
|
|
|
}
|
|
|
|
};
|