Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | List of all members
cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched > Class Template Reference

Mixin for rotations and reflections following the standard pattern of "apply mask, then use a switch". More...

#include <Mixins.h>

Inheritance diagram for cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >:
Inheritance graph
[legend]
Collaboration diagram for cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >:
Collaboration graph
[legend]

Public Member Functions

constexpr cMetaRotator (BLOCKTYPE a_BlockType)
 

Protected Member Functions

virtual NIBBLETYPE MetaMirrorXY (NIBBLETYPE a_Meta) const override
 
virtual NIBBLETYPE MetaMirrorYZ (NIBBLETYPE a_Meta) const override
 
virtual NIBBLETYPE MetaRotateCCW (NIBBLETYPE a_Meta) const override
 
virtual NIBBLETYPE MetaRotateCW (NIBBLETYPE a_Meta) const override
 
 ~cMetaRotator ()=default
 

Detailed Description

template<class Base, NIBBLETYPE BitMask, NIBBLETYPE North, NIBBLETYPE East, NIBBLETYPE South, NIBBLETYPE West, bool AssertIfNotMatched = false>
class cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >

Mixin for rotations and reflections following the standard pattern of "apply mask, then use a switch".

Inherit from this class providing your base class as Base, the BitMask for the direction bits in bitmask and the masked value for the directions in North, East, South, West. There is also an aptional parameter AssertIfNotMatched, set this if it is invalid for a block to exist in any other state.

Definition at line 60 of file Mixins.h.

Constructor & Destructor Documentation

◆ cMetaRotator()

template<class Base , NIBBLETYPE BitMask, NIBBLETYPE North, NIBBLETYPE East, NIBBLETYPE South, NIBBLETYPE West, bool AssertIfNotMatched = false>
constexpr cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >::cMetaRotator ( BLOCKTYPE  a_BlockType)
inlineconstexpr

Definition at line 65 of file Mixins.h.

◆ ~cMetaRotator()

template<class Base , NIBBLETYPE BitMask, NIBBLETYPE North, NIBBLETYPE East, NIBBLETYPE South, NIBBLETYPE West, bool AssertIfNotMatched = false>
cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >::~cMetaRotator ( )
protecteddefault

Member Function Documentation

◆ MetaMirrorXY()

template<class Base , NIBBLETYPE BitMask, NIBBLETYPE North, NIBBLETYPE East, NIBBLETYPE South, NIBBLETYPE West, bool AssertIfNotMatched = false>
virtual NIBBLETYPE cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >::MetaMirrorXY ( NIBBLETYPE  a_Meta) const
inlineoverrideprotectedvirtual

Reimplemented in cBlockDoorHandler.

Definition at line 116 of file Mixins.h.

◆ MetaMirrorYZ()

template<class Base , NIBBLETYPE BitMask, NIBBLETYPE North, NIBBLETYPE East, NIBBLETYPE South, NIBBLETYPE West, bool AssertIfNotMatched = false>
virtual NIBBLETYPE cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >::MetaMirrorYZ ( NIBBLETYPE  a_Meta) const
inlineoverrideprotectedvirtual

Reimplemented in cBlockDoorHandler.

Definition at line 132 of file Mixins.h.

◆ MetaRotateCCW()

template<class Base , NIBBLETYPE BitMask, NIBBLETYPE North, NIBBLETYPE East, NIBBLETYPE South, NIBBLETYPE West, bool AssertIfNotMatched = false>
virtual NIBBLETYPE cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >::MetaRotateCCW ( NIBBLETYPE  a_Meta) const
inlineoverrideprotectedvirtual

Reimplemented in cBlockLeverHandler, and cBlockDoorHandler.

Definition at line 74 of file Mixins.h.

◆ MetaRotateCW()

template<class Base , NIBBLETYPE BitMask, NIBBLETYPE North, NIBBLETYPE East, NIBBLETYPE South, NIBBLETYPE West, bool AssertIfNotMatched = false>
virtual NIBBLETYPE cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >::MetaRotateCW ( NIBBLETYPE  a_Meta) const
inlineoverrideprotectedvirtual

Reimplemented in cBlockLeverHandler, and cBlockDoorHandler.

Definition at line 95 of file Mixins.h.


The documentation for this class was generated from the following file: