2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BlockHandler.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 04:06:34 -04:00
|
|
|
/** Handler for blocks that have 3 orientations (hay bale, log), specified by the upper 2 bits in meta.
|
|
|
|
Additionally supports the metadata specifying block sub-type in its lower 2 bits. */
|
2020-10-05 06:27:14 -04:00
|
|
|
class cBlockSidewaysHandler final :
|
2019-10-16 04:06:34 -04:00
|
|
|
public cBlockHandler
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
2020-04-13 12:38:06 -04:00
|
|
|
using Super = cBlockHandler;
|
2019-10-16 04:06:34 -04:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
public:
|
2019-10-16 04:06:34 -04:00
|
|
|
|
2020-09-20 09:50:52 -04:00
|
|
|
using Super::Super;
|
2019-10-16 04:06:34 -04:00
|
|
|
|
2020-09-20 09:50:52 -04:00
|
|
|
private:
|
2019-10-16 04:06:34 -04:00
|
|
|
|
2021-03-28 09:41:34 -04:00
|
|
|
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem * const a_Tool) const override
|
2014-03-24 14:52:35 -04:00
|
|
|
{
|
2021-05-05 09:25:10 -04:00
|
|
|
// Reset the orientation part of meta, keep the sub-type part of meta:
|
2019-10-16 04:06:34 -04:00
|
|
|
return cItem(m_BlockType, 1, a_BlockMeta & 0x03);
|
2014-03-24 14:52:35 -04:00
|
|
|
}
|
2013-07-29 07:13:03 -04:00
|
|
|
} ;
|